Data Uploading

Shapefiles

Shapefiles are a pain.

One of the (many) issues that make Shapefiles difficult to work with is the fact that a shapefile commonly refers to a collection of files with ".shp", ".shx", ".dbf", and other extensions on a common prefix name. The actual shapefile relates specifically to files with the ".shp" extension, however this file alone is incomplete for distribution, as the other supporting files are required. Often users as asked to provide the entire package as a ZIP or some such, but that is hardly an intuitive thing to demand of users.

There is also a large list of optional files, including ".prj" for projection information and ".shp.xml" for metadata in XML format.

Precedents

GeoCommons Shapefile Upload

GeoCommons has a pretty handy way of dealing with this problem. They have a general purpose form (pictured below) for uploading files that supports CSV, KML, Shapefile, etc.

http://img.skitch.com/20100126-qc7cypqqr6q9uuf4r4y2kyq2kw.png

When a user attempts to upload a file with extension ".shp", however, the form dynamically expands (pictured below) to prompt the user to include the (required) ".shx" and ".dbf" files as well as an (optional) ".prj" file.

http://img.skitch.com/20100126-ms3cs3k97t7rc6mejmb8fxtx2g.png