What the hell is a mapfart?
A simple web service to take a geodata POST and try to make a map from it.
What do I need to install to use it?
Nothing... it just uses Curl
What the hell is Curl?
This service might not be for you...
When might this be useful?
In a headless situation (i.e. on a remote server) where you want to preview the geodata... Then again... maybe it is totally useless...
What do I get?
Nothing... you POST. All kidding aside, you get a PNG image back.
What formats are supported?
Well, we dont actually "support" anything... this is a toy. If you want to try it out, send over GeoJSON, WKT, or WKB and cross your fingers.
What tools are being used?
GeoJSON is rendered using Mapserver, WTK and WKB are rendered via Geometry Tools (just for fun)
What was the inspiration?
Set it up please:
Simple (default)
alias mapfart='curl -H "Content-Type: application/octet-stream" --data-binary @- mapfart.com/api/fart'
Crunchy (change output projection) (example EPSG:3857)
alias mapfart='curl -H "Content-Type: application/octet-stream" --data-binary @- mapfart.com/api/3857/fart'
Hipster (change output projection AND mapsize) (example EPSG:3857, 2000x2000px)
alias mapfart='curl -H "Content-Type: application/octet-stream" --data-binary @- mapfart.com/api/3857/2000/2000/fart'
Examples please:
Simple GeoJSON file
z-air:~ aaronr$ cat geojson.json | mapfart
Local Shapefile via ogr2ogr
z-air:~ aaronr$ ogr2ogr -f GeoJSON /vsistdout/ ne_110m_admin_0_countries.shp -sql "select * from ne_110m_admin_0_countries where name='United States'" | mapfart
Remote Shapefile via ogr2ogr
z-air:~ aaronr$ ogr2ogr -f GeoJSON /vsistdout/ /vsizip/vsicurl/http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip/ne_110m_admin_0_countries.shp -sql "select * from ne_110m_admin_0_countries where name='United States' or name='Germany'" | mapfart
Postgis via ogr2ogr
z-air:~ aaronr$ ogr2ogr -f "GeoJSON" /vsistdout/ PG:dbname=test ne_admin_bounds -where "name = 'United States'" | mapfart
WKT as text
z-air:~ aaronr$ echo 'LINESTRING(3 4,10 50,20 25)' | mapfart
WKB as text (bbox of United States)
z-air:~ aaronr$ echo '0103000020E61000000100000005000000F8DD2EC7507965C020EC866D8BEA3240F8DD2EC7507965C08CAA3399E5D651409AF04BFDBCBD50C08CAA3399E5D651409AF04BFDBCBD50C020EC866D8BEA3240F8DD2EC7507965C020EC866D8BEA3240' | mapfart
WKB (single shape) via psql
z-air:~ aaronr$ psql -A -t -c "select geom from ne_admin_bounds where name = 'United States'" testdb | mapfart
z-air:~ aaronr$ geom buffer -g 'LINESTRING(3 4,10 50,20 25)' -d 2 | mapfart