Fix JavaDoc errors

This commit is contained in:
Phyks (Lucas Verney) 2018-12-04 17:23:28 +01:00
parent d621964863
commit 780e865870
14 changed files with 124 additions and 128 deletions

View file

@ -13,11 +13,11 @@ import java.util.HashMap;
import java.util.List;
/**
* URL query parameter handler for web and standalone server. Supports all
* URL query parameter handler for web and standalone server. Supports all
* BRouter features without restrictions.
*
*
* Parameters:
*
*
* lonlats = lon,lat|... (unlimited list of lon,lat waypoints separated by |)
* nogos = lon,lat,radius|... (optional, radius in meters)
* profile = profile file name without .brf
@ -25,8 +25,8 @@ import java.util.List;
* 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
* http://localhost:17777/brouter?lonlats=1.1,1.2|2.1,2.2|3.1,3.2|4.1,4.2&nogos=-1.1,-1.2,1|-2.1,-2.2,2&profile=shortest&alternativeidx=1&format=kml
* {@code http://localhost:17777/brouter?lonlats=8.799297,49.565883|8.811764,49.563606&nogos=&profile=trekking&alternativeidx=0&format=gpx}
* {@code http://localhost:17777/brouter?lonlats=1.1,1.2|2.1,2.2|3.1,3.2|4.1,4.2&nogos=-1.1,-1.2,1|-2.1,-2.2,2&profile=shortest&alternativeidx=1&format=kml}
*
*/
public class ServerHandler extends RequestHandler {
@ -59,7 +59,7 @@ public class ServerHandler extends RequestHandler {
rc.localFunction = profile;
rc.setAlternativeIdx(Integer.parseInt(params.get( "alternativeidx" )));
List<OsmNodeNamed> nogoList = readNogoList();
List<OsmNodeNamed> nogoPolygonsList = readNogoPolygons();
@ -89,14 +89,14 @@ public class ServerHandler extends RequestHandler {
if (lonLats == null) throw new IllegalArgumentException( "lonlats parameter not set" );
String[] coords = lonLats.split("\\|");
if (coords.length < 2)
if (coords.length < 2)
throw new IllegalArgumentException( "we need two lat/lon points at least!" );
List<OsmNodeNamed> wplist = new ArrayList<OsmNodeNamed>();
for (int i = 0; i < coords.length; i++)
{
String[] lonLat = coords[i].split(",");
if (lonLat.length < 2)
if (lonLat.length < 2)
throw new IllegalArgumentException( "we need two lat/lon points at least!" );
wplist.add( readPosition( lonLat[0], lonLat[1], "via" + i ) );
}
@ -106,7 +106,7 @@ public class ServerHandler extends RequestHandler {
return wplist;
}
@Override
public String formatTrack(OsmTrack track)
{
@ -175,7 +175,7 @@ public class ServerHandler extends RequestHandler {
result = "text/tab-separated-values";
}
}
return result;
}
@ -197,10 +197,10 @@ public class ServerHandler extends RequestHandler {
{
if ( vlon == null ) throw new IllegalArgumentException( "lon " + name + " not found in input" );
if ( vlat == null ) throw new IllegalArgumentException( "lat " + name + " not found in input" );
return readPosition(Double.parseDouble( vlon ), Double.parseDouble( vlat ), name);
}
private static OsmNodeNamed readPosition( double lon, double lat, String name )
{
OsmNodeNamed n = new OsmNodeNamed();
@ -209,7 +209,7 @@ public class ServerHandler extends RequestHandler {
n.ilat = (int)( ( lat + 90. ) *1000000. + 0.5);
return n;
}
private List<OsmNodeNamed> readNogoList()
{
// lon,lat,radius|...
@ -227,7 +227,7 @@ public class ServerHandler extends RequestHandler {
return nogoList;
}
private static OsmNodeNamed readNogo( String lon, String lat, String radius )
{
return readNogo(Double.parseDouble( lon ), Double.parseDouble( lat ), Integer.parseInt( radius ) );
@ -250,7 +250,7 @@ public class ServerHandler extends RequestHandler {
parseNogoPolygons( params.get("polygons"), result, true );
return result.size() > 0 ? result : null;
}
private static void parseNogoPolygons(String polygons, List<OsmNodeNamed> result, boolean closed )
{
if ( polygons != null )
@ -277,6 +277,6 @@ public class ServerHandler extends RequestHandler {
}
}
}
}
}
}
}