Tag Info

New answers tagged

0

The problem is caused by null inputs of the createSubType function. If you have a glance at the DataUtilities#createSubType you will see: public static SimpleFeatureType createSubType(SimpleFeatureType featureType, String[] properties, CoordinateReferenceSystem override, String typeName, URI namespace) throws SchemaException { if ...


0

You can use the onEachFeature option of the GeoJSON layer to append the popups to each feature. And you can switch the popup contents inside of the onEachFeature function. I made an example on jsfiddle that you can use to see how it works. As you can see, the example displays a GeoJSON Layer with three markers on the map, two makers are cities with code of ...


0

Like the others already said, JTS does know nothing about geodesy or projections or coordinate systems. JTS does "linear geometry on the 2-dimensional Cartesian plane" (http://tsusiatsoftware.net/jts/main.html). If you do not want to pull in another library and if the strict mathematical solution on a sphere is enough, you can simply implement the haversine ...


1

You could use the Java implementation of GeographicLib to solve the inverse geodesic problem on WGS84. import net.sf.geographiclib.*; ... private double calculateDistance( double lon1, double lat1, double lon2, double lat2) { GeodesicData g = Geodesic.WGS84.Inverse(lat1, lon1, lat2, lon2); return g.s12; // distance in ...


4

The short answer is you can't do that unless your points are very close together and you want the answer in degrees. JTS knows nothing about units or the curvature of the earth. So you need to pull in some GeoTools jars that do know about such things. Then you can create a method like: private void calculateDistance( ...


0

The Esri Geometry API for Java documentation states that it implements geometry for a plane, so will not take the Date Line into account: In geometry-api-java, the geometry is planar with the exception of GeometryEngine.geodesicDistanceOnWGS84. The X/Y values are considered on an infinite plane, and all operations are executed based on that assumption. ...


0

Which AMI are you using? I have successfully installed GeoServer using Ubuntu 14.04 with Tomcat7 many times. This tutorial helped me when I was starting out. Installing GeoServer is simple after you get Tomcat and the web interface properly installed. The only other thing you need to do is change tomcat's default file size which is a bit too small for ...


0

Thanks @iant, you are right, Tomcat 8.0.24 has apparently some issues. I just tested it with Tomcat 8.0.20 and it worked fine. So now I have GeoServer up and running on Tomcat 8.0.22 using Java 8 (Oracle).


2

I would suggest looking at the GDAL/OGR libraries and their Java bindings. The javadocs are here, gdal.org . They're in the in the Maven repo as well. (Not tried the Java bindings, only the python ones, but they look identical). The following question gives an example of what you're trying to do (it's in python, but the java bindings should be the same). ...


1

I have solved this issue now and for those interested, the code is posted below... I help you all find this helpful: public final class ExportLayerToShapefileAction extends SelectionAction { public ExportLayerToShapefileAction() { super("gsExportToShapefile"); } @Override protected void doActionPerformed(ActionEvent e) { IFeatureSelection ...


1

Oracle Spatial comes with a collection of Java APIs, and one of them lets you read shapefiles. That API is documented here: http://docs.oracle.com/database/121/SPAJV/toc.htm. Look for the oracle.spatial.util package, specifically class ShapefileFeatureJGeom. It uses lower level classes that perform the actual reading of the shapefile (DBFReaderJGeom and ...


1

This is a simple operation in GeoTools, once you have read in the Shapefile you will have a FeatureCollection which you just need to write to an Oracle Datastore. I have an example of how to write a Database (mysql and postgis are the examples included) here.


0

The easy way is to go with option 2 and the URL it wants is the location of the XSD file which will be in the top of the GML that is within your ServletRequest. So you need to open the root element and extract the namespaces and schema URLs. Then you can create the name and URL from that: GML gml = new GML(Version.WFS1_0); gml.setCoordinateReferenceSystem( ...


0

Finally I used geo-fence, a geoserver plugin for security management. It has a Restful API for adding,managing,ect of users,roles,rules,....



Top 50 recent answers are included