reafactor gisdbapi

This commit is contained in:
lukasgol committed 2015-01-26 18:26:24 +01:00
1 parent 52df739b64
commit 31c46b4a4a
2 files changed
+5 -5

No files matched your search

@@ -16,9 +16,9 @@ import java.util.List;
@Component
public class GisDbApi {
private static final String GET_LAMP = "SELECT osm_id,tags,st_transform(way,4326) FROM planet_osm_point WHERE highway='street_lamp'";
private static final String GET_LAMPS = "SELECT osm_id,tags,st_transform(way,4326) FROM planet_osm_point WHERE highway='street_lamp'";
private static String PUT_LAMP = "INSERT INTO public.gis_points(gis_points_id, way, highway) VALUES (@, st_geomfromtext('POINT(@ @)',4326), 'street_lamp');";
private static final String GET_LAMPS = "SELECT st_transform(way,900913) FROM gis_points WHERE gis_points_id = ?;";
private static final String GET_LAMP = "SELECT st_transform(way,900913) FROM gis_points WHERE gis_points_id = ?;";
private static final String DELETE_LAMP = "DELETE FROM public.gis_points WHERE gis_points_id = ?";
JdbcTemplate gisJdbcTemplate;
@@ -39,11 +39,11 @@ public class GisDbApi {
}
public List<GisLamp> getAllLamps() {
return gisJdbcTemplate.query(GET_LAMP, new GisRowMapperForLamps());
return gisJdbcTemplate.query(GET_LAMPS, new GisRowMapperForLamps());
}
public List<GisPoint> getLamp(long id) {
return gisJdbcTemplate.query(GET_LAMPS, new Object[]{id}, new PointRowMapper());
return gisJdbcTemplate.query(GET_LAMP, new Object[]{id}, new PointRowMapper());
}
public int putLamp(long id, double x, double y) {
@@ -24,7 +24,7 @@ public final class APIServicePaths {
//GIS
public static final String GIS_CONTROLLER = "/gis";
public static final String GET_ALL_LAMPS = "/lamp";
public static final String GET_ALL_LAMPS = "/lamps";
public static final String PUT_LAMP = "/lamp";
public static final String DELETE_LAMP = "/lamp";
public static final String GET_LAMP = "/lamp";