Re: Geometry vs Geography Data Type for PostGIS PostgreSQL database
On Sat, 20 Oct 2012 17:24:26 -0700 (PDT), JJ Zolper
<codingatmt@gmail.com> declaimed the following in
gmane.comp.python.django.user:
Initial comment: Your question is probably better asked in a
PostgreSQL/PostGIS group, or in some other mapping related forum. It is
not, technically, a Django matter.
>
> "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.
>
<snip>
> - 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.
>
No... As I understand it, "geometry" type is more of a localized
grid on a flat plane...
http://postgis.org/documentation/manual-1.5/ch04.html
"""
The basis for the PostGIS geometry type is a plane. The shortest path
between two points on the plane is a straight line. That means
calculations on geometries (areas, distances, lengths, intersections,
etc) can be calculated using cartesian mathematics and straight line
vectors.
The basis for the PostGIS geographic type is a sphere. The shortest path
between two points on the sphere is a great circle arc. That means that
calculations on geographies (areas, distances, lengths, intersections,
etc) must be calculated on the sphere, using more complicated
mathematics. For more accurate measurements, the calculations must take
the actual spheroidal shape of the world into account, and the
mathematics becomes very complicated indeed.
"""
The problem, in your case, is how to handle the borders between
"grids".
For example, UTM splits the earth into "orange slice" zones. The
center of each zone is given the same coordinates, and areas near the
poles (~+/- 80deg latitude -- the poles use UPS grid) don't cover the
full width of the zone. Coordinates are in meters. If you have someone
on the edge of one UTM zone, 25 miles may easily be in the adjacent UTM
zone. But the coordinates, as meters may be way different.
That is, a spot near the west edge of the right-hand zone may have
an easting coordinate of 125000m. The a spot in the adjacent zone to the
left (west), only 10 meters away, may have an easting of 875000m
In geodetic coordinates, those two spots may only be 1sec longitude
different.
> 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
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
--
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