5 ms·
The situation is bad for Shapefiles because people forget to export the prj file and it can get lost in the process of transformation. I feel your frustration -
by sabman 8y ago
The situation is bad for Shapefiles because people forget to export the prj file and it can get lost in the process of transformation. I feel your frustration - it's just a very old format which encodes data into 4 different files.
This however, has nothing to do with PostGIS. PostGIS will ingest any geo data you give it. and if you don't know the SRID you can use -1. As for the problem of Shapefiles there are better alternative formats now like geojson and spatialite based geodatabases that encode SRID in a single file.
- giancarlostoro 8y agoI sort of hope GeoJSON takes off a bit more, it just seems easier to work with at the very minimum with things like Leaflet. Of course you have Bing which uses their own objects for their latest rendition of the Bing Maps v8 JS API. Thankfully using Leaflet we were able to use their imagery instead. Having dealt with Shapefiles I can say it definitely felt like dealing with something quite dated, especially compared to how much simpler JSON can be.
- dagw 8y agoEverybody is hoping something other than shape files eventually takes off, as its's universally agreed to be a pretty terrible format. The problem is that the industry hasn't unified around a single format with GeoJSON, GeoPackage and to a lesser extend KML all trying to become the next shape file. As it stands however, everybody and everything can read shape files and that cannot be said about any other format.
- cwmma 8y agoThe real annoying thing is that one of the reasons shapefiles are so bad, and so hard to replace is they fill a bunch of niches in a half assed way and no sane replacement format is going to replace shapefile in all situations. Need a standardized way to disseminate data that's super easy to ingest? GeoJSON and KML work great there, while GeoPackage is going to be not a great fit for things like APIs plus you can't do a streaming read. Need a way to edit and work with data locally and maybe send stuff around your office? Geopackage is going to be a much better fit then GeoJSON or KML.
- dagw 8y agoAnother 'hidden' feature of shape files that I've seen regularly abused (and abused myself more than once) is that they use the standard dBASE format to store their data. Meaning that all kinds of apps that know nothing about shape files (like Excel or Access) can be used to read and analyse the data stored within them.
- cwmma 8y agoalso the encoding of the database is stored in a file that ends in `.cpg` which I'm pretty sure stands for code page. Source: I wrote a shapefile parser and generator.
- quaunaut 8y agoWhat does an SRID of -1 do? Also, most of the data I'm using doesn't have a GeoJSON version publically available- I'm having to trust that someone else converted it correctly, and at a satisfiable resolution.
- cwmma 8y ago-1 means unknown projection, though for GeoJSON you can usually assume it's either going to have an EPSG code in there or it's 4326 (the only differences in GeoJSON versions is that in newer versions of GeoJSON it HAS to be in 4326 and in older ones it could say it was something else but most things will break if they get a GeoJSON that's not 4326 even if the GeoJSON has it's CRS info in it).