New answers tagged

1

Sorry for reviving an old thread, the same question came up in the context of the geopackage specification so I thought I might as well answer it here too. The reason you need all these empty geometry types is because the ISO SQL/MM part 3 specification requires them (not explicitly, but indirectly). As an example ST_Intersection needs to be able to return ...


6

Another way is to specify the spatial Reference by name, for instance, Geographic Coordinate Systems/World/WGS 1984. The following snippet tested on ArcGIS 10.5 and worked as expected: import arcpy from arcpy import env ws = env.workspace = r"F:\Ahmad\Test\PT" fc = "Cities.shp" sr = arcpy.SpatialReference("Geographic Coordinate Systems/World/WGS 1984") ...


6

Since your feature class is in GCS_WGS_1984, you don't need to specify any Coordinate System. Though, if you want to add coord_sys explicitly, you can use one of those: EPSG code as string e.g. "4326" EPSG code as integer e.g. 4326 SpatialReference object # as string arcpy.AddGeometryAttributes_management(parcel_feat, "POINT_X_Y_Z_M", "", "", "4326") #OR ...


4

The only thing I can guess is that the coordinate system parameter needs to be a coordinate system data type. You're passing a string "GCS_WGS_1984", however, the documentation states that it should be a coordinate system instead. Try modifying your code to declare coord_sys as follows: coord_sys = arcpy.SpatialReference(4326) The sample code in the ...


0

Though I know this question is for QGIS 2, anyone here looking for an answer for QGIS 3: Processing --> Toolbox --> Vector Geometry --> Fix Geometries Just for context, I needed to do this after I received the following error: Feature (820) has invalid geometry. Please fix the geometry or change the Processing setting to the "Ignore invalid input features"...


1

Without your geometry, I used one stored in my GEE assets and the following version of your code ran but, the downloading task also crushes at few seconds as you said. var clipToCol = function(image){ return image.clip(export_geometry_2); }; var export_geometry_2 = ee.FeatureCollection("users/joseguerreroa/utah/utah_bounds"); var dataset = ee....


3

In geopandas <= v0.6.3., gdf.crs returns a dictionary like {'init': 'epsg:EPSG_CODE'}. So, more appropriate way is to use tools of geopandas defined in geopandas.tools module. geom_srid_num = gpd.tools.crs.epsg_from_crs(gdf.crs) print(geom_srid_num) # OUT: 32616 -> int EDIT: As @snowman2 states in comment, epsg_from_crs is deprecated in geopandas v0....


2

You could forgo your latitude and longitude fields, making your tables lighter. Instead you could have a simple int field with your target fid. Of course, my answer assumes working with projected data, as far as distances are concerned, where map units are meters. Here's a quick mockup of the required table for the lines to work: I added an fid column for ...


0

The Thinness Ratio describes the relation between a polygons perimeter to its area using geometric attributes of a circle as a basis for comparison. A definition can be found in Microscope Image Processing, page 201. For a circle, we know that A = pi * r^2 and p = 2 * pi * r Solving the perimeter equation for r gives: r = p / (2 * pi) which can then ...


-1

As commented by @Vince: Never, ever use the Polygon constructor without a SpatialReference (spatial_reference is the second parameter). But your problem is failure to create new Point objects, so the Array just has one repeating vertex. The code samples provide the template, and they create new Point objects for each loop iteration (it's best ...


Top 50 recent answers are included