Hot answers tagged

4

In The Shapely User Manual -> object.distance(other) Returns the minimum distance (float) to the other geometric object. from shapely.geometry import LineString l1 = LineString([(42.073407, -87.806245), (42.0752508,-87.8080299)]) from shapely.wkt import loads l2 = loads(" LINESTRING(35.442827 -79.470579, 35.444889 -79.469465, 35.445829 -79.468907, ...


2

From the GeoJSON specification https://tools.ietf.org/html/rfc7946: If a Feature has a commonly used identifier, that identifier SHOULD be included as a member of the Feature object with the name "id", and the value of this member is either a JSON string or number. Your GeoJSON has id at wrong level as a member of Polygon object. Move it higher. {...


1

The solution turned out to be rather simple. I used the concave algorithm on all points that have the same property (in my case I used turf.concave), and it returned the desired polygons.


1

The coordinate system could be anything. It could be a local coordinate system, it could be simply nothing, other than a drawing in meters/feet.(or cms, who knows). Georeferencing would need a lot of information about the drawing, including units, dimensions (ie: Is it a rectnagle or a square? Rotation? Is it aligned north/south. who knows. That makes ...


1

From what i can understand, your layer is not showing when you try to add it through the layer control. Your code was almost right, you just needed to add cluster to overlayMaps instead of geo. This code should work for you. var cluster = L.markerClusterGroup(); var geo = L.geoJSON(dataview, { onEachFeature: function (feature, layer) { layer.bindPopup(...


1

The GeoJSON specification warns about nested GeometryCollections in https://tools.ietf.org/html/rfc7946#page-9 To maximize interoperability, implementations SHOULD avoid nested GeometryCollections. The failing GeometryCollection begins like this when queried with ST_AsText GEOMETRYCOLLECTION(GEOMETRYCOLLECTION EMPTY,MULTILINESTRING((1.... Thus it is a ...


1

Apart from directly fetching feature collection from Postgres itself, if you have an array of Polygon/MultiPolygon you can do - ol.proj.proj4.register(proj4);// This line is optional and required if you have different source projection, here you are registering proj4 js for projection. const polygon = new ol.Feature({ geometry: new ol.geom....


1

It is not clear if the passed in geojson argument is an array of rows of TEXT representing a geometry each. This is assumed in your function. Do you ever hit the "here" console log? As mentioned in comments, better fetch a FeatureCollection (as JSONB) from the DB directly [*]: SELECT JSONB_BUILD_OBJECT( 'type', 'FeatureCollection', ...


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