Tag Info

Hot answers tagged

7

You could use the "proper" ellipsoidal Mercator (EPSG:3395). That projection is truly conformal, as opposed to the "Web Mercator" (EPSG:3857), which uses a spherical approximation. This comes at a computational cost, however (about a factor of 5 for the forward and reverse projection, according to the table on slide 10 of Noel Zinn's presentation). Also, ...


4

I suggest to use an oblique mercator projection as I explained in Using customized Coordinate System for Archaeological site data You have to define the origin in lon and lat WGS84 degrees, and the rotation against true north.


3

You mention Java in your question title but in your question body and tags it seems that ArcGIS for Desktop is available/preferred. The ArcGIS for Desktop procedure that I would use to do this is to perform the following three steps on one CSV file to make sure the workflow works, and then use Copy As Python Snippet to copy the syntax for the three tools ...


3

A couple of options: Convert the PostGIS layer to a shapefile in QGIS (save-as), then use the Vector|Conversion|Rasterize tool; Use the gdal_rasterize command directly. For the second option: gdal_rasterize -a VAL -ts [x] [y] PG:'host=localhost dbname=DB user=USER' -sql "SELECT the_geom, VAL FROM table" out.tif Where: VAL = the value to assign ...


3

Always be aware of the axis order. PostGIS always uses the axis order: longitude (x), latitude (y). -- Somewhere in Chicago, USA SELECT ST_AsText(ST_Transform(ST_SetSRID(ST_Point(-87.642970, 41.937832), 4326), 3857)); -- POINT(-9756370.79201015 5151671.52336743) -- Somewhere in Antarctica SELECT ST_AsText(ST_Transform(ST_SetSRID(ST_Point(41.937832, ...


3

You can use the GeodeticCalculator which should be faster. Something like: package com.envitia.spike; import org.geotools.geometry.DirectPosition2D; import org.geotools.referencing.CRS; import org.geotools.referencing.GeodeticCalculator; import org.opengis.referencing.FactoryException; import org.opengis.referencing.NoSuchAuthorityCodeException; import ...


2

This blog post from 2011 explains the change, basically we dropped the 2 from the version numbers to reflect the actual real world process that was occurring. Currently 10.4 is the latest stable release. GeoTools jars are versioned as a group with version numbers are based on 3 digits:: <major>.<minor>.<patch> Major ...


2

The following is assuming that you know how to read and write a FeatureCollection in geotools. SimpleFeatureCollection inVector = "read it" SimpleFeatureCollection outVector = FeatureCollections.newCollection(); String elevationFieldName = "elev"; int size = inVector.size(); FeatureIterator<SimpleFeature> inFeatureIterator = inVector.features(); ...


2

From the WFS 1.1.0 specification which is freely available in the net: Individual exception messages are contained within the element. The mandatory code attribute may be used to associate an exception code with the accompanying message. The optional locator attribute may be used to indicate where an exception was encountered in the request that ...


1

If you want to use Java, you have a few libraries available including GeoTools and the Java bindings for GDAL/OGR API. Using these you can code a solution (check out the documentation). However, far simpler would be to install GDAL which comes with pre-compiled utilities and use ogr2ogr. You can wrap that in a batch process as required.


1

Might be a bit late to be answering this, but the reasoning for the WMSUtils.getNamedLayers(capabilities) not returning all the layers is give at the following link http://docs.geotools.org/latest/userguide/extension/wms/wms.html WMSUtils The concept of a Layer in WMS is a bit strange. Not all layers are useful (some are abstract and cannot be used, some ...


1

In the loop you are calling Object dnode = feature.getAttribute("directNode");. As described in the SimpleFeature's documentation, the call will return only one node, either the first or the last in the list, the documentation does not say. If you want to retrieve all nodes, you should call getAttributes(). While you need to check the names yourself, it ...


1

You can certainly use GeoTools for this, you will also probably want to look at a relsted project JAITools which does helpful things with rasters. I wrote some code a while back to rasterize circles on to a Grid and output them as GeoTiffs which should point you in the right direction.


1

There are several issues here: OSM uses web mercator (epsg:3857) so that is where your reprojection is going on. Also you need to consider scale - the Natural Earth data is designed to be viewed and used at near to 1:10Million - at that scale your map looks like this and the dot is in the right place. Finally your code can be improved by using a ...


1

I now found the solution. I decided to create a new layer to render the images. The (example) code will be like this: List<SimpleFeature> list = new ArrayList<SimpleFeature>(); SimpleFeature feature = build.buildFeature("fid1", new Object[]{ geom.point(707009.4375,243649.18750000006), "TestImage" } ); list.add( feature ); ...


1

JTS polygons are clockwise (see http://tsusiatsoftware.net/jts/jts-faq/jts-faq.html#B6 for an explanation of why). Why it would give you an invalid geometry is a difficult question to answer with out seeing your input polygons. Most likely causes are self intersection, self touching, invalid geometry in input list.


1

Yes, dealing with distance (or area) in unprojected latitude/longitude coordinates is fraught with peril. The length of a degree of latitude is always the same (60 nautical miles), but the length of a degree of longitude varies with the cosine of the latitude. To do it properly, you want to project your coordinates into some plane coordinate system and do ...


1

General conceptual answer: One suggestion might be to use a national state projection polygon layer to determine the "only" or a selection of the best local projections. The other option would be UTM zones. But essential run a point in polygon test to return the crs. You don't mention but I am reading into you savvy question that you know you would need to ...


1

This seems to be a favourite question on Natural Earths forum ;-) A basic introduction is posted here: http://www.naturalearthdata.com/forums/topic/thematic-codes/ http://www.naturalearthdata.com/forums/topic/are-the-attributes-documented/ http://www.naturalearthdata.com/forums/topic/what-does-mapcolor-mean-in-ne_10m_admin_0_countries/ The mapcolor ...


1

I can confirm that the output is wrong. Using QGIS, the reprojected polygon would be: POLYGON ((1008607.2669 934072.252456,1119664.42733 934150.343933,1119791.41667 823552.360893, 1008616.39888 823493.709278, 1008607.2669 934072.252456)) The coordinates have to be positive for the whole of Colombia: But it has nothing to do with the swiss projection ...


1

You could try the Rasterize tool in QGIS (Raster - Conversion)


1

This can be solved by making a negative buffer (0.5m) for each geometry before testing the overlap. E.g. you have this two overlaping polygons, 1m overlap: By making a negative buffer (-0.5m) of the blue polygon you'll get the yellow one: And this are the two buffered polygons: Running the binary predicate test in JTS test builder, you'll get no ...


1

I'm going to go out on a limb and say that you aren't including the False Easting and False Northing in your XY coordinates. EPSG:4456 states the FE and FN values should be 2000000 and 100000 respectively. Being short 2 million feet on the easting value would explain why your point is in Pennsylvania. If you change your point to include these values ...


1

You can create maps using value by alpha using SLD - (the point being that WA has a lower unemployment rate than OR but has more people so it appears more solid). The trick is to use an expression in the fill-opacity element. If you add the SLD file below to a standard GeoServer install you can see the topp:states layer rendered. In GeoTools it is even ...


1

Did you consider using GDAL? Extensive information, Documentation and examples are available on the Geographical Data Abstraction Library. You can get step-by-step help to compile the GDAL.jar library as described here gdal.ReprojectImage(src_ds, dst_ds) from from GDAL Class seems to be what you are looking for though I have never used it yet.


1

Is it accessible, or did it get dropped in parsing? No, it is very much possible to access any node in a KML file provided you don't miss out on the JAXB hierarchy: You may try something like below: final Kml kml = Kml.unmarshal(new File("C:\\"YOUR DIRECTORY"\\Sample_2013_q3.kml")); final Document document = (Document)kml.getFeature(); ...


1

When you write out your second shapefile you haven't specified the sizes of the columns so they have defaulted to the largest possible size. You need to add something (like): builder.setCRS(DefaultGeographicCRS.WGS84); builder.setName(plotIdentifier); builder.add(sPolygon, Polygon.class); //restrict length of string to 10 chars builder.length(10); ...


1

Make a pull request against the GeoTools data store in question, or open a bug report against GeoTool/GeoServer on jira.codehaus.org (get a login at xircles.codehaus.org)


1

DecimalFormatSymbols symbols; symbols = new DecimalFormatSymbols( Locale.getDefault() ); symbols.setDecimalSeparator('.'); df = new DecimalFormat("#.############", symbols); this.longitude = Double.valueOf( df.format( longitude ) ); this.latitude = Double.valueOf( df.format(latitude ) );


1

With help from people in the GeoTools mailing list, I came up with the complete method that takes a JSON InputStream, optionally a known SimpleFeatureType, and a previously created ShapefileDataStore, and returns a shapefile-backed SimpleFeatureSource. public static SimpleFeatureSource geoJSON2Shp(InputStream input, SimpleFeatureType schema, ...



Only top voted, non community-wiki answers of a minimum length are eligible