Tag Info

New answers tagged

1

This how I would do it: Create your two points Cast polygon into ICurve Use the ICurve.QueryPointAndDistance Method and get the DistanceAlongCurve value for each point Use ICurve.GetSubcurve Method to extract the red curve you have identified in your image.


1

Hmm it should be able to find it if postgis is in your database search path. Trying doing this: ALTER DATABASE your_db SET search_path=public,postgis; Then connect to your database again and do: CREATE EXTENSION fuzzystrmatch; CREATE EXTENSION postgis_tiger_geocoder;


1

If you export the polygon shapefile to a Feature Class inside a File GDB, the "SHAPE_LENGTH" field should contain the perimeter based on the native unit of your coordinate system (e.g. meters for NAD 83, a useless Decimal Degree length for WGS 84, etc.). @Chris's method above works too. You can also manually measure the perimeter of the polygon using ...


2

You need to create a new field in the attribute table of the polygon. When you right-click on this new field, you will have the option to Calculate Geometry. Set the units appropriately and you're on your way.


2

How about partitioning your space into 9 regions and imposing the equal distance criteria separately in each. For example, For line segment #1, partition the space into 3 regions Points whose projection along the line segment normal actually fall on the line segment. Call it C1. Points whose projection along the line segment normal fall to the left of the ...


1

You can take an average of each pair of end points and draw a line between them. Say the left two points have ID 1 and 2, WITH t AS ( SELECT avg(ST_X(geom)) as x, avg(ST_Y(geom)) as y FROM test WHERE gid in (1, 2) ) INSERT INTO test (geom) SELECT ST_SetSRID(ST_MakePoint(t.x, t.y), 4326) FROM t; That creates a new point midway between ...


1

I have recently written a tutorial about the S2 and I think that the S2 is what you really need. I have made the same you need in the tutorial so I won't repeat the code here.


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


3

OK, my original answer was wrong (see user30184's comment). Here's another: The polygon is convex if each angle is 180 degrees or less. You can check this in O(n) time, iterating over the triples of points in the exterior ring and checking the sign of the determinant. import com.vividsolutions.jts.geom.Coordinate; import ...


-1

I've had a similar problem, and it was caused by a corrupt shapefile (which appeared correct in all other aspects). You can test this with "Check Geometry Validity". Oops, sorry.... I see that you've already done that!


1

The only way I can think of converting Lat/Lon columns to geometry on the fly would be to create a view of your table and create a geometry column using STGeomFromText (latColumn, lonColumn, SRID). There is an article here that describes how this is done. In your case, you would publish the view in the method I describe below... I publish views of SQL ...


2

They're well hidden! I found a directory with archives of shapefiles here. There's some documentation here. It looks like the polygons aren't updated regularly, but you can sign up to the mailing list to find out when they are, according to that document. If you download this archive (33MB), the forecast zones are in land_CLCBaseZone_detail_proj.shp. (The ...



Top 50 recent answers are included