Package eu.acclimatize.unison.location
Class GeoJSONLocationController
java.lang.Object
eu.acclimatize.unison.location.GeoJSONLocationController
A controller to obtain an ordered list of location names and coordinates
sorted by location name and formatted as a GeoJSON feature collection.
-
Constructor Summary
ConstructorsConstructorDescriptionGeoJSONLocationController(LocationService locationService) Creates and instance of GeoJSONLocationController. -
Method Summary
Modifier and TypeMethodDescriptionfeatureCollection(javax.servlet.http.HttpServletResponse response) Obtains a feature collection where the features represent a sorted list of all coordinates in the spatial database.Obtains the location for the specified location name.
-
Constructor Details
-
GeoJSONLocationController
Creates and instance of GeoJSONLocationController.- Parameters:
locationService- The service that is used to obtain a list of locations.
-
-
Method Details
-
featureCollection
@GetMapping(value="/locationCollection", produces="application/geo+json") public FeatureCollection featureCollection(javax.servlet.http.HttpServletResponse response) Obtains a feature collection where the features represent a sorted list of all coordinates in the spatial database.- Parameters:
response- The HTTP servlet response used to add the vary header.- Returns:
- A GeoJSON feature collection of point features for the added locations.
-
location
@GetMapping(value="/locationCollection/{name}", produces="application/geo+json") public Location location(javax.servlet.http.HttpServletResponse response, @PathVariable("name") String locationName) Obtains the location for the specified location name.- Parameters:
response- The HTTP servlet response used to add the vary header.locationName- The name of the location.- Returns:
- The location obtained from the repository.
-