Tag Info

New answers tagged

1

Ok, I've figured it out. It is possible to apply an affine transform onto some existing CRS using FITTED_CS. Below is an example of rotation of 60 degrees counterclockwise and movement: FITTED_CS["BPAF", PARAM_MT["Affine", PARAMETER["num_row", 3], PARAMETER["num_col", 3], PARAMETER["elt_0_0", -0.5], PARAMETER["elt_0_1", ...


1

You can define a local rotated coordinate sytem as I explained here: Using customized Coordinate System for Archaeological site data Center point and rotation have to be defined in degrees. Your idea of wrapping one projection with another is not defined in PROJ.4. You can try it out, but don't expect it to work.


1

For the ID simply pass it in to the featureBuilder instead of null; For other properties you need to modify the schema you generated the featureBuilder with. The easiest way to do this is to use DataUtilities.createType SimpleFeatureType TYPE = DataUtilities.createType("Test", "ian:String,location:Point"); final Point point = builder.point(132.159633, ...


1

@whuber's assertion that an equal-area projection "will give absolutely correct areas" comes with an asterisk, namely, assuming that the edges of the polygon are straight lines in said projection. This is often a good approximation, particularly if the edges are short; but it is rarely strictly true. If, on the other hand, the edges of your polygon are ...


0

CRS is not part of the original ESRI shapefile format. QGIS uses two rivaling extension files .qpj and .prj to store CRS information. Both are text files containing Well Known Text (WKT). QPJ is QGIS specific, as far as I know it is not read by other software. PRJ was initially defined by ESRI and exists in various flavours. I assume QGIS tries to create ...


0

The basic algorithm for this is: read in districts read in counties foreach district in districts split district by counties calculate area as % of original GeoTools (and JTS) are able to take care of all of these steps for you, the quickstart tutorial will have shown you how to read in your shapefiles. The query tutorial will get you up to speed on ...


7

"EPSG:3488, EPSG:NAD83(NSRS2007) / California Albers" is an equal-area projection. It is based on the Albers Conic, which is defined for the northern hemisphere. Because Sweden is within its range of definition, it is equal-area in Sweden. This means that (up to floating point rounding error) it will give absolutely correct areas. Neither the Mollweide ...


1

The answer to your question seems to be code like: private FeatureEntry createFeatureEntry(SimpleFeatureType schema, ReferencedEnvelope bbox) { FeatureEntry ret = new FeatureEntry(); ret.setGeometryColumn(schema.getGeometryDescriptor().getLocalName()); GeometryType type = schema.getGeometryDescriptor().getType(); Geometries ...


1

As you surmise you need to change the schema. As schema are immutable you need to copy the existing schema into a new one changing the name of the geometry attribute. You will need something like: public boolean writeFeatures( FeatureCollection<SimpleFeatureType, SimpleFeature> features) { if (shpDataStore == null) { throw new ...


2

DataStore dataStore = ....; // ShapefileDataStore String t = dataStore.getTypeNames()[0]; SimpleFeatureSource featureSource = dataStore.getFeatureSource(t); SimpleFeatureType schema = featureSource.getSchema(); String geomType = schema.getGeometryDescriptor().getType().getBinding().getName(); System.out.println(geomType); It will out one of the following: ...


0

shapefile expects geometry column name only "the_geom". Replace line: stringBuilder.append("location:Point,"); with: stringBuilder.append("the_geom:Point,");


0

The new verion of GeoTools (11.0) has CRS.decode(string epsgCode,boolean longitudeFirst) by which you can make your Coordinate Reference System with desired axis order. CoordinateReferenceSystem crs = CRS.decode("EPSG:4326",false); Then it will has lat,lon order. Your problem is discussed in [geotools user guide for axis order] in detail.


1

A Coordinate Reference System contains two different elements The datum: It defines how the CRS is related to the earth (position of the origin, the scale and the orientation of coordinate axis) e.g. ED50, ETRS89. The datum can be a geodetic datum, a vertical datum or a engineering / local datum. The coordinate system: describes how the coordinates ...


5

CoordinateReferenceSystem is the base Interface from which all other GeoTools SRS are derived from - it is the base class of Geocentric and Geographic projections (and others with vertical and temporal coordinates). It comes from the ISO19111 specification by way of the OGC GeoAPI project. CoordinateSystem is also an interface that comes from ISO19111 and ...


1

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 ...



Top 50 recent answers are included