Tag Info

New answers tagged

1

My lib PyGeoj is specifically meant as a geojson file reader and writer, with a simple API that turns the file contents into objects with attributes, so you don't have to deal with the dictionaries directly. It also has some convenience methods, like calculate and add the bbox for the entire feature collection or just for each feature. So for instance, the ...


2

You probably should just create a new column and I would suggest if you are new to PostGIS, you probably want to use geography instead of geometry. So somethng like ALTER TABLE m_copy ADD COLUMN geog geography(POINT,4326); UPDATE m_copy SET geog = ST_SetSRID(ST_Point(longitude,latitude),4326)::geography; If you decide to use geometry, just replace the ...


0

Alternatively, if you do not have an Advanced license and you do want centroids even if they fall outside the shape, there is another slightly more involved method. Open the polygon attribute table and create two new fields, X and Y. Right-click on each one in turn and use Calculate Geometry to calculate the respective X centroid coordinate and Y centroid ...


1

Sounds like you are using the wrong tool. To create a separate dataset of points that are the centroids of a polygon use the Feature To Point tool. It requires an Advanced license.


0

Yes, you can add columns to a table. The standard SQL statement follows the format of: "alter table add column xyz"


0

Building on @gene 's answer above if you're looking to approximate a curve as a sequence of points using spline interpolation. In Python you can do this through the scipy.interpolate library. Particularly 1d interpolation. For example import numpy as np import scipy.interpolate coords = np.array([[0, 0], [25, 10], [50, 50]]) #The curve fits as a ...


1

That's a feature in pgadmin/PostGIS - it won't show geometry column values if they are too long. It's mentioned in the PostGIS manual http://postgis.net/docs/manual-dev/PostGIS_FAQ.html#pgadmin_shows_no_data_in_geom


1

include ESRI.ArcGIS.DatabaseSourcesFile in your project here is a C# code showes you how to open a shape file,you can convert it to VB.Net simply IWorkspaceFactory ipShapeWF = new ShapefileWorkspaceFactoryClass(); `//strfilepath the path to shape file,include only folder not shape file itself' IWorkspace ipShapeWS = ipShapeWF.OpenFromFile(strfilepath, 0); ...


2

Using IDLE, I ran your test using ArcGIS 10.2.2 for Desktop, immediately after a reboot (by coincidence) so there should be nothing laying around from previous tests. The code is identical to the third example at Writing Geometries, and I agree with you that the point does not get written. I believe that part of the documentation is in error and that ...


2

PyScripter is somewhat lax with object lifetimes and will keep stuff around after it's run. Use the with statement to ensure you close the edit session. import arcpy fc = r"C:\Users\djh\Desktop\topo_map\test.gdb\well_location" xy = (206901.75, 5997594.47) with arcpy.da.InsertCursor(fc, ["SHAPE@XY"]) as cursor: cursor.insertRow([xy])


-1

DXF export only the rows and then copy and paste the features as a new vector layer


0

You can try the computational geometry method Point-in-Polygon (PIP) to identify if the point is inside the polygon. It is the raw math and it must be extremely fast. http://stackoverflow.com/questions/11716268/point-in-polygon-algorithm - this algorithm tests point position relative to each polygon side by the means of vector math.


1

Probably after your requirements get complicated, it is best to think of making a scalable application. The advantage of working with a geometric column is the index, plus you can also work with wkt, GeoJSON and other standards that openlayers postgis and handle very well, so you would simplify the development Here you can find a good tutorial


2

Shapely PyQGIS, and GeoDjango use the same API based on the GEOS library: With Shapely: with a list of points: from shapely.geometry import Point, LineString, mapping pt1 = Point(0,0) pt2 = Point(20,20) pt3 = Point (50,50) line = LineString([pt1,pt2,pt3]) #GeoJSON format print mapping(line) {'type': 'LineString', 'coordinates': ((0.0, 0.0), (20.0, ...


0

In which format [is] geographic data stored in geometry data type of SQL Server 2008. It looks like a long string, like 0xE6100010466DFEOA4089663524… for one polygon. These values are essentially BLOBs (binary large objects): Values of the GEOMETRY and GEOGRAPHY types are encoded in a special binary format which is specified in "[MS-SSCLRT]: Microsoft ...


0

As @user30184 has stated you have performed an update on your RDBMS data without wrapping it in a transaction. Unfortunately there is no way to recover the data without resorting to a backup (unless you have an audit table, which are not as commonly used as they should be). To recover your data you will have to restore from a backup. In the future, utilize ...


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

I'd go with the Geometry Accessors Width: ST_XMax - ST_XMin, and the related functions for Y to give height.



Top 50 recent answers are included