Re: Geometry vs Geography Data Type for PostGIS PostgreSQL database
I would use geography. You never know from where the user is coming, so you don't know the limitations of the projection. If you need extra functionality you can always transform to the most appropriate projection.
2012/10/21 JJ Zolper <codingatmt@gmail.com>
Hello,So I've been researching the pros and cons for my application with regards to geometry or geography data types for my database.I was reading here:I saw that:"The new GEOGRAPHY type allows you to store data in longitude/latitude coordinates, but at a cost: there are fewer functions defined on GEOGRAPHY than there are on GEOMETRY; those functions that are defined take more CPU time to execute.
The type you choose should be conditioned on the expected working area of the application you are building. Will your data span the globe or a large continental area, or is it local to a state, county or municipality?
- If your data is contained in a small area, you might find that choosing an appropriate projection and using GEOMETRY is the best solution, in terms of performance and functionality available.
- If your data is global or covers a continental region, you may find that GEOGRAPHY allows you to build a system without having to worry about projection details. You store your data in longitude/latitude, and use the functions that have been defined on GEOGRAPHY.
- If you don't understand projections, and you don't want to learn about them, and you're prepared to accept the limitations in functionality available in GEOGRAPHY, then it might be easier for you to use GEOGRAPHY than GEOMETRY. Simply load your data up as longitude/latitude and go from there."
I have read this description but I still have a question about what sort of "data" we are talking about. Please let me explain.So my application will use used as a such:The user will put in a criteria for let's say 25 miles. Then the application will return to the user all the results within that range. Adding to this my website will withhold data from across the globe, meaning wherever you are in the world you can perform such a search of 25 miles from your location.Okay so back to the description it says:"The type you choose should be conditioned on the expected working area of the application you are building. Will your data span the globe or a large continental area, or is it local to a state, county or municipality?"
This portion gives me the impression that I would need the geography type because my data will from be all around the world. Any person in any country could operate my geographic tool so my data will not only be from one small town in the US for example. However, again, my queries will only be relative to the users location. I don't have a need for extreme distance and math calculations from let's say the US to Canada or something. It is all fairly short distance calculations. So that gives me the impression that a geometry type would be sufficient.As you can see from my dilemma I'm not sure which option is the right one. If you could help me resolve my confusion I would really appreciate it.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/-/O81mWk74AocJ.
To post to this group, send email to django-users@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.
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home