Geography Reference
In-Depth Information
What Types Should I Use for My Data?
The data types you use depend what your data is representing. If you have a series of
locations representing shops, you'll most likely just want to define those as points. If, on the
other hand, your data represents roads between those points, a multilinestring is probably a
better choice. If you want to mark the building outlines of each shop, you'll want to use a
polygon or multipolygon depending on the complexity of the structure.
There are no hard and fast rules for data types. You only have to keep in mind that if you
don't use a data type appropriate for the operations you expect to perform, you're almost
certain to end up with errors in any calculations you do.
Think back to our shops. If you're searching for the largest one, you need to test for area,
and you can't test for area using a single point. On the other hand, if all you want to do is
provide a searchable map for a customer to find his or her closest shop, you don't need to
store more data than you need, so a simple point will do.
Enough of data layout for now. We'll come back to it in a while. Let's continue with the
metadata tables.
Metadata Tables, Part 2
As mentioned previously, the spatial_ref_sys metadata table holds conversion data to allow
conversions from one coordinate system to another.
Each entry in this table contains specific information such as units of measurement, where
the origin is located, and even the starting offset of a measurement.
Most of us are familiar with seeing a coordinate pair such as this:
54.852726, -1.832299
If you have a GPS built into your mobile phone, fire it up and watch the display. You'll see
something similar to this coordinate pair. Note that on some devices and apps, the
coordinates may be swapped.
This coordinate pair is known as latitude and longitude. The first number, latitude, is the
degrees north or south from the equator with north being positive and south being negative.
The second number, longitude, is the degrees east or west of the Prime Meridian with west
being negative and east being positive. The correct geospatial name for this coordinate
system is WGS84 . Its SRID number is 4326 in the spatial_ref_sys table.
We'll come back to the different coordinate systems and why they exist in just a moment. For
now, let's continue with the description of the spatial reference table. The spatial_ref_sys
table has the following fields:
srid
The spatial reference number as defined by the OGC standards.
auth_name
The authenticating body for this SRID, usually the EPSG.
 
 
Search WWH ::




Custom Search