Query Distance from User

124 views
Skip to first unread message

JJ Zolper

unread,
Jul 15, 2012, 4:58:52 AM7/15/12
to django...@googlegroups.com
So heres my goal:

The user logins in and goes to a discover page. They enter a distance from their location as the requested results scope. Lets say 25 miles from where I live for example. Additionally they could pick like a genre or music but not as important.

So they hit seach and see in a 25 mile spanse in all directions in a circle form the closest artists to their location. From there they can see the top result and click that and step through the top results from 1 to 2 to 3.... To top 10 and so on as much as their heart desires.

So i was thinking maybe GeoIP might be good because it will use the users location and last known GeoIP of the artist for example.

I was curious if anyone had any ideas or better ideas then I had.

Thanks so much,

JJ Zolper

Kurtis Mullins

unread,
Jul 15, 2012, 5:30:07 AM7/15/12
to django...@googlegroups.com
Why not just have them enter their location? I'd comment more but I work for a commercial site that looks like it might be treading in the same area so I don't wanna get myself in trouble here :)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/_ERIIZrolmUJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Nicolas Emiliani

unread,
Jul 15, 2012, 2:22:53 PM7/15/12
to django...@googlegroups.com
On Sun, Jul 15, 2012 at 1:58 AM, JJ Zolper <codin...@gmail.com> wrote:
So heres my goal:

The user logins in and goes to a discover page. They enter a distance from their location as the requested results scope. Lets say 25 miles from where I live for example. Additionally they could pick like a genre or music but not as important.

So they hit seach and see in a 25 mile spanse in all directions in a circle form the closest artists to their location. From there they can see the top result and click that and step through the top results from 1 to 2 to 3.... To top 10 and so on as much as their heart desires.

So i was thinking maybe GeoIP might be good because it will use the users location and last known GeoIP of the artist for example.


I'm currently developing a project based on google maps, and it sounds that you might want to take a look at their API,
You could use markers (latitude and longitude) for your artists, ask the user to place themselves on the map and then
calculate if they are on the wanted area or not.
 

I was curious if anyone had any ideas or better ideas then I had.

Thanks so much,

JJ Zolper

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/_ERIIZrolmUJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Nicolas Emiliani

Lo unico instantaneo en la vida es el cafe, y es bien feo.

Markus Gattol

unread,
Jul 15, 2012, 3:30:16 PM7/15/12
to django...@googlegroups.com
You can use geolocation https://developers.google.com/maps/articles/geolocation and if that's not accurate enough let the user provide his address and with it query Google's https://developers.google.com/maps/documentation/javascript/geocoding API

The tricky bit here is if you want to get the lat/lng back onto your server so you can store it in your database. I ended up using https://github.com/abourget/gevent-socketio and store stuff in MongoDB using mongoengine.

Markus Gattol

unread,
Jul 15, 2012, 3:31:40 PM7/15/12
to django...@googlegroups.com
I can also recommend https://github.com/HPNeo/gmaps as a wrapper, speeds up and simplifies dealing with Google's API a lot.

JJ Zolper

unread,
Jul 15, 2012, 4:29:29 PM7/15/12
to django...@googlegroups.com
Now that you mention it I like this idea a lot better! Okay I've changed my mind. My goal is to have the user input their location and then from there I run that againist my database of artists and depending on the request show the artists that are in those respective areas.

That's okay that you can't go into detail! I appreciate the input a lot nonetheless!
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.

JJ Zolper

unread,
Jul 15, 2012, 4:37:10 PM7/15/12
to django...@googlegroups.com
I've heard from many resources that Google Maps API is one of the main preferred options. Thanks for sharing what you use!

What you have just explained seems to be a good option! Is the option to use latitude and longitude a very common one? I'm not 
as familiar as to which options of calculation have known to be the most stable, usable, fast, or efficient. Or there is any common
knowledge about the such thing.

Here's what I'm thinking. First the user enters their town for example so Vienna, VA. Then they choose how far from their location so 25 miles. But then they also have an advanced search option where they can refine their request even more. They are able to play around with a Google Map on the side and zoom into their physical house location on the map and put a marker/point there of some sort. This could be lat/long I don't know yet. This way if that data checks out they get and even more accurate representation of the artists in their area. Any thoughts or opinions on how you think I
should go about this?

Thanks so much! 

JJ 


On Sunday, July 15, 2012 10:22:53 AM UTC-4, Nicolas Emiliani wrote:
On Sun, Jul 15, 2012 at 1:58 AM, JJ Zolper <codin...@gmail.com> wrote:
So heres my goal:

The user logins in and goes to a discover page. They enter a distance from their location as the requested results scope. Lets say 25 miles from where I live for example. Additionally they could pick like a genre or music but not as important.

So they hit seach and see in a 25 mile spanse in all directions in a circle form the closest artists to their location. From there they can see the top result and click that and step through the top results from 1 to 2 to 3.... To top 10 and so on as much as their heart desires.

So i was thinking maybe GeoIP might be good because it will use the users location and last known GeoIP of the artist for example.


I'm currently developing a project based on google maps, and it sounds that you might want to take a look at their API,
You could use markers (latitude and longitude) for your artists, ask the user to place themselves on the map and then
calculate if they are on the wanted area or not.
 

I was curious if anyone had any ideas or better ideas then I had.

Thanks so much,

JJ Zolper

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/_ERIIZrolmUJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

JJ Zolper

unread,
Jul 15, 2012, 4:47:12 PM7/15/12
to django...@googlegroups.com
I appreciate the input!

I've given the whole GeoIP and geolocation idea some thought and for me I think I've decided for my desktop version to steer clear of those
sort of options for the time being. Why? Well I want their to be extreme flexibility but also very accurate information. What do I mean? Well:

First the user enters their town for example so Vienna, VA. Then they choose how far from their location so 25 miles. But then they also have an advanced search option where they can refine their request even more. They are able to play around with a Google Map on the side and zoom into their physical house location on the map and put a marker/point there of some sort. This could be lat/long I don't know yet. This way if that data checks out they get an even more accurate representation of the artists in their area. Any thoughts or opinions on how you think I should go about this?

Currently I don't know if I will end up using Lat/Long as I'm too far to the beginning of development but it's a current option unless I hear of new things.

As you pointed out its tricky. Well, I can't confirm that quite yet. But I do appreciate you giving me what you used to make the Lat/Long work. I 
see that MongoDB is NoSQL? Do you use NoSQL for everything you are doing? I'm currently on PostgreSQL and I'm not sure how that would tie
into my project yet. What specs do you have? What system are you running?

Thanks,

JJ

JJ Zolper

unread,
Jul 15, 2012, 4:48:18 PM7/15/12
to django...@googlegroups.com
Thanks for the tip! I will keep record of this!

lacry...@gmail.com

unread,
Jul 15, 2012, 5:20:25 PM7/15/12
to django...@googlegroups.com

It highly depends on what you want to do, the extension of the area you want to cover, and things like that. There's different projection systems for each area in the world, and making distance calculations on those projections is much faster than on global (lat lon) coordinates, but they're not accurate outside of the area they're designed for. Conversion between systems are easy enough.

-----Mensaje original-----
De: JJ Zolper
Enviados: 15/07/2012 13:37:10
Asunto: Re: Query Distance from User

I've heard from many resources that Google Maps API is one of the main
preferred options. Thanks for sharing what you use!

What you have just explained seems to be a good option! Is the option to
use latitude and longitude a very common one? I'm not
as familiar as to which options of calculation have known to be the most
stable, usable, fast, or efficient. Or there is any common
knowledge about the such thing.

Here's what I'm thinking. First the user enters their town for example so
Vienna, VA. Then they choose how far from their location so 25 miles. But
then they also have an advanced search option where they can refine their
request even more. They are able to play around with a Google Map on the
side and zoom into their physical house location on the map and put a
marker/point there of some sort. This could be lat/long I don't know yet.
This way if that data checks out they get and even more accurate
representation of the artists in their area. Any thoughts or opinions on
how you think I
should go about this?

Thanks so much!

JJ
>> django-users...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Nicolas Emiliani
>
> Lo unico instantaneo en la vida es el cafe, y es bien feo.
>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/nuuh9ynmJPQJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

Nicolas Emiliani

unread,
Jul 15, 2012, 5:22:10 PM7/15/12
to django...@googlegroups.com


What you have just explained seems to be a good option! Is the option to use latitude and longitude a very common one? I'm not 
as familiar as to which options of calculation have known to be the most stable, usable, fast, or efficient. Or there is any common
knowledge about the such thing.

Well with (lat, long) you can point to any place on earth, it's like having an (x,y) point on a cartesian plane. 
And yes, it is the standard method.
 

Here's what I'm thinking. First the user enters their town for example so Vienna, VA. Then they choose how far from their location so 25 miles. But then they also have an advanced search option where they can refine their request even more. They are able to play around with a Google Map on the side and zoom into their physical house location on the map and put a marker/point there of some sort. This could be lat/long I don't know yet. This way if that data checks out they get and even more accurate representation of the artists in their area. Any thoughts or opinions on how you think I
should go about this?


With the (lat,long) that belongs to the user position yo can then ask for a radius in blocks, meters o whatever.
So, now you can get the surface of a circle and with some basic math you go through your db checking if any artist
are inside the limit of that circle.
Message has been deleted

JJ Zolper

unread,
Jul 15, 2012, 8:36:37 PM7/15/12
to django...@googlegroups.com
Well as far as what I want to do I explained that above.

User requests in all directions a circle spanse of 25 miles i.e. and theres a return of artists in that area.

As far as the area I want to cover I would like to start with the northern virginia area and expand from there. A goal set for the entire United States if that gives you an idea.

Well if possible I would like 1 system to cover the entire United States I dont want to have to handle like okay so in minnesota what system am i going to make for them or in los angeles what system for them. Im going to a massive spanse of land here i want flexibility so the user can be like im in VA but traveling to FL for the weekend I want to see some bands playing there and see if they have shows etc etc etc.

Thanks,

JJ

JJ Zolper

unread,
Jul 15, 2012, 8:39:12 PM7/15/12
to django...@googlegroups.com
Awesome sounds like lat long is the way to go to be able to cover the entire US.

And yeah im pretty good at math thanks for the tip Ill work on that soon!

JJ Zolper

unread,
Jul 15, 2012, 11:12:23 PM7/15/12
to django...@googlegroups.com
I'm also thinking since Northern VA is so big in terms of people if I get a good thing going here I can port that to other major cities but if I find a less server heavy method I can use that for smaller areas possibly. Not sure, I'll see.

JJ

JJ Zolper

unread,
Jul 15, 2012, 11:18:40 PM7/15/12
to django...@googlegroups.com
By UTM do you mean Universal Transverse Mercator?

Well hmm I'm not quite sure what issue i would run into with someone living on the edge of the zone.

Typically this request is a one time thing. The request goes in and the person either is within (on the line inside) the boundary
or they are just out side. There are no moving parts here no flow of data across the screen just a direct request and a 
return of who fits that data. This search doesn't have to be built proof I mean I just want to get a basis of how to do this
so I can see what happens.

Also the portion about meters confuses me. Whats the benefit of the portion at the end?

On Sunday, July 15, 2012 4:23:34 PM UTC-4, Dennis Lee Bieber wrote:
On Sun, 15 Jul 2012 09:47:12 -0700 (PDT), JJ Zolper
<codin...@gmail.com> declaimed the following in
gmane.comp.python.django.user:


> First the user enters their town for example so Vienna, VA. Then they
> choose how far from their location so 25 miles. But then they also have an
> advanced search option where they can refine their request even more. They
> are able to play around with a Google Map on the side and zoom into their
> physical house location on the map and put a marker/point there of some
> sort. This could be lat/long I don't know yet. This way if that data checks
> out they get an even more accurate representation of the artists in their
> area. Any thoughts or opinions on how you think I should go about this?
>
        I'm tempted to suggest using UTM internally, but you'd probably end
up with somebody living on the edge of a zone, and having to special
case the search radius as it crosses the zone boundary.

        Reason to consider UTM? Coordinates are in meters, and computing if
a point is within a 40000m (40km => ~25 miles) just becomes a case of
applying Pythagoras [sqrt((x1-x2)^2 + (y1-y2)^2) <= radius].

http://www.uwgb.edu/dutchs/usefuldata/utmformulas.htm
--
        Wulfraed                 Dennis Lee Bieber         AF6VN
        wlf...@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Jani Tiainen

unread,
Jul 15, 2012, 11:20:45 PM7/15/12
to django...@googlegroups.com
Or if your database backend supports spatial fields, you can let the database to do the hard work and use Geodjango (built-in GIS extension) which supports spatial operations like query by distance within.

I think most standard databases can do that (mysql, postgresql, sqlite, oracle) but I would recommend postgres + postgis if possible. 

Then everything is just matter of taste, you can pick pretty much any coordinate system and you get the results you want. No math involved.

To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/xqKHuCVictIJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

JJ Zolper

unread,
Jul 15, 2012, 11:41:38 PM7/15/12
to django...@googlegroups.com
Yeah I'm trying to get GeoDjango set up as we speak. GeoDjango sounds awesome.

I have postgresql and Im trying to install postgis but im getting this:

Connecting to postgis.refractions.net (postgis.refractions.net)|199.103.56.11|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3749293 (3.6M) [application/x-gzip]
Saving to: `postgis-1.5.2.tar.gz'

100%[======================================>] 3,749,293    345K/s   in 7.1s    

2012-07-15 19:40:20 (516 KB/s) - `postgis-1.5.2.tar.gz' saved [3749293/3749293]

jjz@jjz-Laptop:~$ tar xzf postgis-1.5.2.tar.gz
jjz@jjz-Laptop:~$ cd postgis-1.52
bash: cd: postgis-1.52: No such file or directory
jjz@jjz-Laptop:~$ cd postgis-1.5.2
jjz@jjz-Laptop:~/postgis-1.5.2$ ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking how to run the C preprocessor... gcc -E
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking whether we are using the GNU C++ compiler... (cached) no
checking whether g++ accepts -g... (cached) no
checking if gcc supports -Wall... yes
checking if gcc supports -Wmissing-prototypes... yes
checking if gcc supports -ffloat-store... yes
checking for flex... no
checking for lex... no
checking for bison... no
checking for byacc... no
checking ieeefp.h usability... no
checking ieeefp.h presence... no
checking for ieeefp.h... no
checking for convert... no
configure: WARNING: ImageMagick does not seem to be installed. Documentation cannot be built
checking for xsltproc... no
configure: WARNING: xsltproc is not installed so documentation cannot be built
checking for dblatex... no
configure: WARNING: dblatex is not installed so PDF documentation cannot be built
configure: WARNING: could not locate Docbook stylesheets required to build the documentation
checking CUnit/CUnit.h usability... no
checking CUnit/CUnit.h presence... no
checking for CUnit/CUnit.h... no
configure: WARNING: could not locate CUnit required for liblwgeom unit tests
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for libiconv_open in -liconv... no
checking for iconv_open in -lc... yes
checking for iconvctl... no
checking for libiconvctl... no
checking for pg_config... /usr/bin/pg_config
checking PostgreSQL version... PostgreSQL 9.1.4
checking libpq-fe.h usability... yes
checking libpq-fe.h presence... yes
checking for libpq-fe.h... yes
checking for PQserverVersion in -lpq... yes
checking for xml2-config... no
configure: error: could not find xml2-config from libxml2 within the current path. You may need to try re-running configure with a --with-xml2config parameter.
jjz@jjz-Laptop:~/postgis-1.5.2$ make
make -C liblwgeom 
make[1]: Entering directory `/home/jjz/postgis-1.5.2/liblwgeom'
gcc -g -O2  -fno-common -DPIC  -Wall -Wmissing-prototypes  -c -o measures.o measures.c
In file included from measures.h:16:0,
                 from measures.c:18:
liblwgeom.h:18:31: fatal error: ../postgis_config.h: No such file or directory
compilation terminated.
make[1]: *** [measures.o] Error 1
make[1]: Leaving directory `/home/jjz/postgis-1.5.2/liblwgeom'
make: *** [liblwgeom] Error 2
jjz@jjz-Laptop:~/postgis-1.5.2$ sudo make install
[sudo] password for jjz: 
make -C liblwgeom 
make[1]: Entering directory `/home/jjz/postgis-1.5.2/liblwgeom'
gcc -g -O2  -fno-common -DPIC  -Wall -Wmissing-prototypes  -c -o measures.o measures.c
In file included from measures.h:16:0,
                 from measures.c:18:
liblwgeom.h:18:31: fatal error: ../postgis_config.h: No such file or directory
compilation terminated.
make[1]: *** [measures.o] Error 1
make[1]: Leaving directory `/home/jjz/postgis-1.5.2/liblwgeom'
make: *** [liblwgeom] Error 2
jjz@jjz-Laptop:~/postgis-1.5.2$ cd ..
jjz@jjz-Laptop:~$ 

Which I feel like is an error?

Wow really that sounds too good to be true haha its sounding better already!

Thomas Lockhart

unread,
Jul 15, 2012, 11:47:36 PM7/15/12
to django...@googlegroups.com
On 7/15/12 4:41 PM, JJ Zolper wrote:
Yeah I'm trying to get GeoDjango set up as we speak. GeoDjango sounds awesome.
I have postgresql and Im trying to install postgis but im getting this:
FIx your errors in the configure step before bothering to try building. In this case you need libxml2 installed; should be available in your distro (as is Postgres). If you are using the distro Postgres then you will probably want to install postgis as root.

hth

                           - Tom

To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/W-SrqDO5vxMJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

JJ Zolper

unread,
Jul 16, 2012, 12:46:55 AM7/16/12
to django...@googlegroups.com
I was able to get passed the first error about libxml2 but now I'm here:

jjz@jjz-Laptop:~/Desktop$ tar xzf postgis-2.0.1.tar.gz
jjz@jjz-Laptop:~/Desktop$ cd postgis-2.0.1
jjz@jjz-Laptop:~/Desktop/postgis-2.0.1$ ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... no
checking for mawk... mawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ant... no
checking for cpp... /usr/bin/cpp
checking if gcc supports -Wall... yes
checking if gcc supports -Wmissing-prototypes... yes
checking if gcc supports -ffloat-store... yes
checking for flex... no
checking for lex... no
checking for bison... no
checking for byacc... no
checking ieeefp.h usability... no
checking ieeefp.h presence... no
checking for ieeefp.h... no
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for vasprintf... yes
checking for asprintf... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for perl... /usr/bin/perl
checking for convert... /usr/bin/convert
checking for xsltproc... no
configure: WARNING: xsltproc is not installed so documentation cannot be built
checking for xmllint... no
configure: WARNING: xmllint is not installed so documentation cannot be checked
checking for dblatex... no
configure: WARNING: dblatex is not installed so PDF documentation cannot be built
configure: WARNING: could not locate Docbook stylesheets required to build the documentation
checking CUnit/CUnit.h usability... no
checking CUnit/CUnit.h presence... no
checking for CUnit/CUnit.h... no
configure: WARNING: could not locate CUnit required for liblwgeom unit tests
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for libiconv_open in -liconv... no
checking for iconv_open in -lc... yes
checking for iconvctl... no
checking for libiconvctl... no
checking for pg_config... /usr/bin/pg_config
checking PostgreSQL version... PostgreSQL 9.1.4
checking libpq-fe.h usability... yes
checking libpq-fe.h presence... yes
checking for libpq-fe.h... yes
checking for PQserverVersion in -lpq... yes
checking for xml2-config... /usr/bin/xml2-config
checking libxml/tree.h usability... yes
checking libxml/tree.h presence... yes
checking for libxml/tree.h... yes
checking libxml/parser.h usability... yes
checking libxml/parser.h presence... yes
checking for libxml/parser.h... yes
checking libxml/xpath.h usability... yes
checking libxml/xpath.h presence... yes
checking for libxml/xpath.h... yes
checking libxml/xpathInternals.h usability... yes
checking libxml/xpathInternals.h presence... yes
checking for libxml/xpathInternals.h... yes
checking for xmlInitParser in -lxml2... yes
checking for geos-config... no
configure: error: could not find geos-config within the current path. You may need to try re-running configure with a --with-geosconfig parameter.
jjz@jjz-Laptop:~/Desktop/postgis-2.0.1$ ./configure --with-geosconfig=/home/jjz/Desktop/Django/Geo/geos-3.3.5/tools
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... no
checking for mawk... mawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ant... no
checking for cpp... /usr/bin/cpp
checking if gcc supports -Wall... yes
checking if gcc supports -Wmissing-prototypes... yes
checking if gcc supports -ffloat-store... yes
checking for flex... no
checking for lex... no
checking for bison... no
checking for byacc... no
checking ieeefp.h usability... no
checking ieeefp.h presence... no
checking for ieeefp.h... no
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for vasprintf... yes
checking for asprintf... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for perl... /usr/bin/perl
checking for convert... /usr/bin/convert
checking for xsltproc... no
configure: WARNING: xsltproc is not installed so documentation cannot be built
checking for xmllint... no
configure: WARNING: xmllint is not installed so documentation cannot be checked
checking for dblatex... no
configure: WARNING: dblatex is not installed so PDF documentation cannot be built
configure: WARNING: could not locate Docbook stylesheets required to build the documentation
checking CUnit/CUnit.h usability... no
checking CUnit/CUnit.h presence... no
checking for CUnit/CUnit.h... no
configure: WARNING: could not locate CUnit required for liblwgeom unit tests
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for libiconv_open in -liconv... no
checking for iconv_open in -lc... yes
checking for iconvctl... no
checking for libiconvctl... no
checking for pg_config... /usr/bin/pg_config
checking PostgreSQL version... PostgreSQL 9.1.4
checking libpq-fe.h usability... yes
checking libpq-fe.h presence... yes
checking for libpq-fe.h... yes
checking for PQserverVersion in -lpq... yes
checking for xml2-config... /usr/bin/xml2-config
checking libxml/tree.h usability... yes
checking libxml/tree.h presence... yes
checking for libxml/tree.h... yes
checking libxml/parser.h usability... yes
checking libxml/parser.h presence... yes
checking for libxml/parser.h... yes
checking libxml/xpath.h usability... yes
checking libxml/xpath.h presence... yes
checking for libxml/xpath.h... yes
checking libxml/xpathInternals.h usability... yes
checking libxml/xpathInternals.h presence... yes
checking for libxml/xpathInternals.h... yes
checking for xmlInitParser in -lxml2... yes
configure: error: the user-specified geos-config file /home/jjz/Desktop/Django/Geo/geos-3.3.5/tools does not exist
jjz@jjz-Laptop:~/Desktop/postgis-2.0.1$ ./configure --with-geosconfig=/home/jjz/Desktop/Django/Geo/geos-3.3.5/tools/geos-config
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... no
checking for mawk... mawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ant... no
checking for cpp... /usr/bin/cpp
checking if gcc supports -Wall... yes
checking if gcc supports -Wmissing-prototypes... yes
checking if gcc supports -ffloat-store... yes
checking for flex... no
checking for lex... no
checking for bison... no
checking for byacc... no
checking ieeefp.h usability... no
checking ieeefp.h presence... no
checking for ieeefp.h... no
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for vasprintf... yes
checking for asprintf... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for perl... /usr/bin/perl
checking for convert... /usr/bin/convert
checking for xsltproc... no
configure: WARNING: xsltproc is not installed so documentation cannot be built
checking for xmllint... no
configure: WARNING: xmllint is not installed so documentation cannot be checked
checking for dblatex... no
configure: WARNING: dblatex is not installed so PDF documentation cannot be built
configure: WARNING: could not locate Docbook stylesheets required to build the documentation
checking CUnit/CUnit.h usability... no
checking CUnit/CUnit.h presence... no
checking for CUnit/CUnit.h... no
configure: WARNING: could not locate CUnit required for liblwgeom unit tests
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for libiconv_open in -liconv... no
checking for iconv_open in -lc... yes
checking for iconvctl... no
checking for libiconvctl... no
checking for pg_config... /usr/bin/pg_config
checking PostgreSQL version... PostgreSQL 9.1.4
checking libpq-fe.h usability... yes
checking libpq-fe.h presence... yes
checking for libpq-fe.h... yes
checking for PQserverVersion in -lpq... yes
checking for xml2-config... /usr/bin/xml2-config
checking libxml/tree.h usability... yes
checking libxml/tree.h presence... yes
checking for libxml/tree.h... yes
checking libxml/parser.h usability... yes
checking libxml/parser.h presence... yes
checking for libxml/parser.h... yes
checking libxml/xpath.h usability... yes
checking libxml/xpath.h presence... yes
checking for libxml/xpath.h... yes
checking libxml/xpathInternals.h usability... yes
checking libxml/xpathInternals.h presence... yes
checking for libxml/xpathInternals.h... yes
checking for xmlInitParser in -lxml2... yes
Using user-specified geos-config file: /home/jjz/Desktop/Django/Geo/geos-3.3.5/tools/geos-config
./configure: line 16640: /home/jjz/Desktop/Django/Geo/geos-3.3.5/tools/geos-config: Permission denied
./configure: line 16641: /home/jjz/Desktop/Django/Geo/geos-3.3.5/tools/geos-config: Permission denied
./configure: line 16642: /home/jjz/Desktop/Django/Geo/geos-3.3.5/tools/geos-config: Permission denied
./configure: line 16646: /home/jjz/Desktop/Django/Geo/geos-3.3.5/tools/geos-config: Permission denied
checking GEOS version... 
configure: error: PostGIS requires GEOS >= 3.1.1
jjz@jjz-Laptop:~/Desktop/postgis-2.0.1$ 


I had already stepped through geos-3.3.5 and included the geos-config file but now it says it needs greated then 3.1.1 but it definitely has that.

Any idea?

Jani Tiainen

unread,
Jul 16, 2012, 7:59:46 AM7/16/12
to django...@googlegroups.com
I really suggest that you install postgres + postgis using packages provided by your distribution. It would guarantee installation of all dependencies and you can just concentrate using it.

But below it's shown that configure script can't access geos-config (permission denied) so you might need to run postgis configure as a root as well.

To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/bl41pHlwmdEJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

tWoolie

unread,
Jul 16, 2012, 9:11:34 AM7/16/12
to django...@googlegroups.com
Just use Lat/Lon. You can fidget over which projection to use later as long as your data is good. (WGS84 is the best btw)

For geolocation, you can use the HTML5 Geolocation API that will use the person's browser to give you a location usually accurate to 200m (better if they're on a phone with gps), more than enough given your search radius of 200miles.

For distance lookups, go with a simple bounding box algorithm (bounded by map edges, distance calc by pythagoras). Again exact positioning is NOT ESSENTIAL for your use case, especially on the 25mi scale.

If you ever find yourself needing better/more accurate position calculation. use postgis, but never install from source, use your distro's packages (it Just Works tm). Should be called 'postgresql-9.1-postgis' on most distros. do a search. make sure you have libproj and libgeos installed as well.
Message has been deleted

JJ Zolper

unread,
Jul 17, 2012, 3:48:59 AM7/17/12
to django...@googlegroups.com
So wait,

Does UTM have to do with the timezones in the USA? Do some of the lines match to tomezone lines? You also never really answered my question before. Sure it sounds like you know what UTM is but I sure dont and thats all youre talking about.

If this is about the timezones or whatever then yes I can sort of imagine the issue youre talking about. I know what pythagoreans theorem is im a math guy but i cant quite pick how it applies to any of what we are talking about. Are you saying i need it to be able to calculate the circle and distances from a point in a 25 mile radius so x^2 +y^2 = 25 mi ^2?

Sorry if i seem slow. Still new to this.

JJ

JJ Zolper

unread,
Jul 17, 2012, 4:03:17 AM7/17/12
to django...@googlegroups.com
I absolutely agree! That sounds like a much better way to install postgis and the other various packages.

No more fiddling with my configure issues. I will try installing all of it tomorrow.

JJ Zolper

unread,
Jul 17, 2012, 4:08:47 AM7/17/12
to django...@googlegroups.com
Just use Lat/Lon. You can fidget over which ojection to use later as long as your data is good. (WGS84 is the best btw)

I agree lat long sounds beautiful to me! Well thats good.


For geolocation, you can use the HTML5 Geolocation API that will use the person's browser to give you a location usually accurate to 200m (better if they're on a phone with gps), more than enough given your search radius of 200miles.

Oh okay ill keep that in mind in case i make a iphone app cause right now i like the idea of lat long.

For distance lookups, go with a simple bounding box algorithm (bounded by map edges, distance calc by pythagoras). Again exact positioning is NOT ESSENTIAL for your use case, especially on the 25mi scale.

What about a circle? Use lat long equated to a city or address and do a circle with that point in lat long and find all the data within the circle?

If you ever find yourself needing better/more accurate position calculation. use postgis, but never install from source, use your distro's packages (it Just Works tm). Should be called 'postgresql-9.1-postgis' on most distros. do a search. make sure you have libproj and libgeos installed as well.

Is "it just works" a programming catch phrase? Haha. Yes the distros this next time not the other way.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages