Hot answers tagged

6

Using PostGIS, I used ST_ConvexHull to simplify the polygon for a faster result: Get the furthest Point: SELECT ST_PointN(ST_ExteriorRing(ST_ConvexHull(the_geom)),Generate_Series(1, ST_NPoints(ST_ExteriorRing(ST_ConvexHull(the_geom))))) as FarPoint FROM PolyTable; And if you are interested in creating a Circle from the centroid: SELECT ST_Buffer(Center,...


3

It looks like you're mixing up data access update cursors and calculate field. Use the data access update cursor (it's faster): with arcpy.da.UpdateCursor (StreetCenterlines, ["Latitude", "Longitude", "SHAPE@X", "SHAPE@Y"]) as cursor: for lat, long, x, y in cursor: row = (x, y, x, y) cursor.updateRow (row)


2

Right click the Field Name which is in your case [kml_name] go to Field Calculator and write "Karaikal". The double quotation mark is must, and it will update all your cells at once. Based on Feature To Polygon tool, there is an option to preserve the attribute. you need to check that. If it is unchecked, the attribute will not be preserved. I think you ...


2

You donĀ“t need to bring your calculated field in the return part of the function: Try: if [Area_Ha] <=70 then [Area_Ha]^1.22 * 2.85 else ([Area_Ha]+9.97)*7.1 end if


1

Using next PyQGIS code (1 hour ago this answer had QGIS tag): from math import sqrt layer = iface.activeLayer() feats = [ feat for feat in layer.getFeatures() ] n = len(feats) centroids = [ feat.geometry().centroid().asPoint() for feat in feats ] polygons = [ feat.geometry().asPolygon()[0] for feat in feats ] lengths = [] for i, pol in enumerate(...


1

It looks like you are working with MapInfo. The "Distance Calculator" (find it in tool manager) has many options and I think it can handle this task too. There is an article about it here: http://web.pb.com/mapinfopro-jul-2013/Toolbox-Distance-Calculator


1

@JasonBK @jasonbk The CreateMapSDDraft method used in this sample asks for a {folder_name} parameter that was setted to None, so by default it points to root level (see below). If you want to use a sub folder you must specify this instead of None, so in the sample you will use something like this: analysis = arcpy.mapping.CreateMapSDDraft(mapDoc, sddraft,...


1

GetCount returns a Result object and not an integer or a string. To get a string you use the getOuput method of the result object and pull its first part. To see any other parts try switching the 0 for 1, 2, etc. If you need to turn that string into an integer then use an int() function. To learn more about the Result object and its getOutput method ...



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