poprawki
This commit is contained in:
1 parent
9eb8f56961
commit
64379da3c4
3 files changed
+1
-65
No files matched your search
@@ -1,37 +0,0 @@
|
||||
package hello.agh.edu.bazy.row;
|
||||
|
||||
import org.postgis.Point;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
|
||||
/**
|
||||
* Created by mar on 24.01.15.
|
||||
*/
|
||||
@XmlRootElement
|
||||
public class GisLamp {
|
||||
private final long id;
|
||||
private final Point location;
|
||||
private String tag;
|
||||
|
||||
public GisLamp(long id, Point location) {
|
||||
this.id = id;
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Point getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package hello.agh.edu.bazy.row.mappers;
|
||||
|
||||
import hello.agh.edu.bazy.row.GisLamp;
|
||||
import org.postgis.PGgeometry;
|
||||
import org.postgis.Point;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Created by mar on 24.01.15.
|
||||
*/
|
||||
public class GisRowMapperForLamp implements RowMapper<GisLamp> {
|
||||
|
||||
private static final String COORDINATE_COLUM_NNAME = "st_transform";
|
||||
private static final String OSM_ID = "osm_id";
|
||||
private static final String TAG ="tag" ;
|
||||
|
||||
@Override
|
||||
public GisLamp mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||
PGgeometry geometry = (PGgeometry)rs.getObject(COORDINATE_COLUM_NNAME);
|
||||
GisLamp lamp = new GisLamp(rs.getLong(OSM_ID),(Point) geometry.getGeometry());
|
||||
lamp.setTag(rs.getString(TAG));
|
||||
return lamp;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package hello.agh.edu.bazy.row.mappers;
|
||||
package hello.agh.edu.bazy.row.mappers.gis;
|
||||
|
||||
import hello.agh.edu.bazy.row.gis.GisLamp;
|
||||
import org.postgis.PGgeometry;
|
||||
|
||||
Reference in new issue
Block a user