我是geoserver的新手,我想在输入某个地址时获得经纬度,但我没有成功。我不知道该怎么做。 我已下载了几个形状文件,并能够将其加载到地理服务器并加载地图。现在我想传递地址并获得lat长 我试过以下,请帮忙:
包地理服务器;
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher; import it.geosolutions.geoserver.rest.GeoServerRESTReader;
import java.io.File;
公共类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();
}
}
}