ROGUE-JCTD / Grout

MIT License
4 stars 2 forks source link

How to store SRID #1

Open antinodes opened 12 years ago

antinodes commented 12 years ago

Should the SRID be stored as asimple integer or should it include the Authority Name?

pepijnve commented 12 years ago

Only an integer ID is not sufficient since this does not carry any semantics. Would you assume EPSG codes in that case? What about non-EPSG codes? I would opt for storing the entire srs definition rather than just a code as is done in the spatial_ref_sys table of vector spatial databases.

antinodes commented 12 years ago

So the options are:

  1. Store the Authority Name and number * admittedly not a good approach since there isn't enough information this way for any projection tools to actually use without outside knowledge
  2. Store the WKT of the SRS a. Store the SRS directly in the tilesets table b. Store the SRS in a spatial_ref_sys table and store a foreign key to the spatial_ref_sys table in the tilesets table
  3. Store the bounds information in the SRS of the tilesets and use a geometry encoding that includes the SRS information

Did I miss an option?

pepijnve commented 12 years ago

2a is what we did in our tile format. 2b is similar but if you're only using one SRS in the database it felt like overkill. 3 is equivalent to 1 and/or 2b in the EWKT case since you're only storing an SRID code which in the postgis case is a reference to the primary key of the spatial_ref_sys table.