add GeoJSON track format

This commit is contained in:
Norbert Renner 2014-08-23 20:54:22 +02:00
parent 3f49938e2a
commit 76c1641899
2 changed files with 46 additions and 1 deletions

View file

@ -21,7 +21,7 @@ import java.util.List;
* nogos = lon,lat,radius|... (optional, radius in meters)
* profile = profile file name without .brf
* alternativeidx = [0|1|2|3] (optional, default 0)
* format = [kml|gpx] (optional, default gpx)
* format = [kml|gpx|geojson] (optional, default gpx)
*
* Example URLs:
* http://localhost:17777/brouter?lonlats=8.799297,49.565883|8.811764,49.563606&nogos=&profile=trekking&alternativeidx=0&format=gpx
@ -100,6 +100,10 @@ public class ServerHandler extends RequestHandler {
else if ("kml".equals(format))
{
result = track.formatAsKml();
}
else if ("geojson".equals(format))
{
result = track.formatAsGeoJson();
}
else if ("csv".equals(format))
{
@ -141,6 +145,10 @@ public class ServerHandler extends RequestHandler {
{
result = "application/vnd.google-earth.kml+xml";
}
else if ( "geojson".equals( format ) )
{
result = "application/vnd.geo+json";
}
else if ( "csv".equals( format ) )
{
result = "text/tab-separated-values";