I am new to geoserver, i am trying to get latitude and longitude on input of some address, but i am not successful . I have no idea how to do this. I have downloaded few shape files and able to load it into geoserver and load the map . Now i want to pass the address and get the lat long.
I have tried with following, please help:
package geoserver;
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; import it.geosolutions.geoserver.rest.GeoServerRESTReader;
import java.io.File;
public class GeoREST {
public static void main(String[] args) {
String RESTURL = "http://localhost:8080/geoserver";
String RESTUSER = "admin";
String RESTPW = "geoserver";
try {
GeoServerRESTReader reader = new
GeoServerRESTReader(RESTURL,RESTUSER, RESTPW);
GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(
RESTURL, RESTUSER, RESTPW);
boolean created = publisher.createWorkspace("myWorkspace");
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + created);
File zipFile = new File("D:/IDM-Marvin/Geoserver/nyc_roads.zip");
boolean published = publisher.publishShp("myWorkspace", "myStore",
"nyc_roads", zipFile, "EPSG:4326", "default_point");
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + published);
System.out.println("::::::::::::Done:::::::::::::::::::::::");
} catch (Exception e) {
e.printStackTrace();
}
}
}
It will depend on what other tools you can use, it looks like. Based on this question it looks like you need to use WMS extension to get the lat-long. Hope that helps.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다