Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 99589

Any of a set of two or more numbers used to determine the position of a point, line, curve, or plane in a space of a given dimension with respect to a system of lines or other fixed references.

1 vote

Getting list of arrays from MultiLineString object with Python

__geo_interface__.get('coordinates'))) mapping function: from shapely.geometry import MultiLineString, mapping coords = [((0.0, 0.0), (0.0, 20.0)), ((20.0, 0.0), (20.0, 20.0)), ((1.0569687968009744 … 10.96695601450711, 7.213267528511481)), ((13.884688806883744, 0.35179537762349833), (15.348360220796115, -6.498103101647066))] mlines = MultiLineString(coords) print(list(mapping(mlines).get('coordinates
Taras's user avatar
  • 34k
0 votes

Drawing routes (on road shapefile) between X,Y coordinates in QGIS

I can suggest a PyQGIS solution. It utilizes the openpyxl Python package. Let's assume there is an Excel file called 'testbook' with the following data provided on the 'Sheet1': Proceed with Plugins …
Taras's user avatar
  • 34k
2 votes

Converting MGRS to Lat/Lon or UTM

There is a nice online coordinates converter for WGS84, UTM, CH1903, UTMREF(MGRS), Gauß-Krüger, NAC, W3W: https://coordinates-converter.com/en/ …
Taras's user avatar
  • 34k
2 votes

"ValueError: Point coordinates must be finite." when reverse geocoding in DataFrame using GeoPy

nan_) UF SIGLA LATITUDE LONGITUDE 47 RJ9 NaN NaN Another solution could be almost the same as was demonstrated in ValueError: Must be a coordinate pair or Point i.e. wrapping coordinates … (nan, nan, 0.0) has been passed as coordinates. …
Taras's user avatar
  • 34k
1 vote

Extracting latitude and longitude pairs as list from LineString in GeoPandas

5337643.246403), (428840.7437, 5395427.193238)] )] } gdf = gpd.GeoDataFrame(d, crs="EPSG:25832") def line_to_coords(geom): m = mapping(geom) list_of_tuples = m['coordinates
Taras's user avatar
  • 34k
2 votes
Accepted

Iterating over each pair of coordinates in Multipart geometry using Shapely

Try this piece of code: from shapely.geometry import Polygon exterior = [(2, 8), (7, 8), (7, 3), (2, 3), (2, 8)] interior = [(4, 7), (4, 5), (6, 5), (6, 7), (4, 7)] interior2 = [(3, 5), (3, 4), (4, 4 …
Taras's user avatar
  • 34k
2 votes

Importing text file with coordinates with "N12.345" and "E6.789" as shapefile in QGIS

Here is another approach. Step 1. Drag&Drop your .xlsx file with all tables into QGIS, So, they all will be visible in the Layers Panel Step 2. Use a "Virtual Layer" through Layer > Add Layer > Add/ …
Taras's user avatar
  • 34k
3 votes
Accepted

Converting OGR geometry as WKT of polygon from float to integer in the WKT string

geom.GetGeometryCount() # Create ring newRing = ogr.Geometry(ogr.wkbLinearRing) for i in range(numRings): ring = geom.GetGeometryRef(i) numPoints = ring.GetPointCount() for j in range(numPoints): coordinates … = (round(ring.GetPoint(j)[0]), round(ring.GetPoint(j)[1])) #also works as coordinates = (round(ring.GetX(j)), round(ring.GetY(j))) newRing.AddPoint_2D(coordinates[0], coordinates[1]) …
Taras's user avatar
  • 34k
1 vote

Converting OGR geometry as WKT of polygon from float to integer in the WKT string

451967.898155319,75198.5338269215 452182.812141684,75322.6144748018 452397.726128049,75570.7757705624 452397.726128049,75694.8564184426 452182.812141684))' geom = ogr.CreateGeometryFromWkt(testpolywkt) coordinates … = json.loads(geom.ExportToJson())['coordinates'][0] coordinates_rounded = [[round(pair[0]), round(pair[1])] for pair in coordinates] # Create ring ring = ogr.Geometry(ogr.wkbLinearRing) for pair in …
Taras's user avatar
  • 34k
5 votes

Getting coordinates of individual polygon in shapefile

You can also get your points simply via points: The points attribute contains a list of tuples containing an (x,y) coordinate for each point in the shape. import shapefile shape = shapefile.Reader( …
Taras's user avatar
  • 34k
12 votes
Accepted

Converting polygon to list of coordinates with shapely

Here is another solution using the mapping(): returns a new, independent geometry with coordinates copied from the context. … import json from shapely.geometry import Polygon, mapping poly = Polygon([[14.471329,46.037286],[14.467378,46.036733],[14.468441,46.034822]]) poly_mapped = mapping(poly) poly_coordinates = poly_mapped['coordinates
Taras's user avatar
  • 34k
5 votes

Geocoding addresses to coordinates in QGIS

For QGIS versions QGIS 3.20 and higher Starting from QGIS 3.20 it is possible to geocode addresses to coordinates by means of the native tool "Batch Nominatim geocoder", can be found under Vector General … Make use of the "Add X/Y fields to layer" to get coordinates. Change the CRS if needed Step 5. Get the final output …
Taras's user avatar
  • 34k
5 votes

Extracting Latitude/Longitude from polygon vertices in QGIS

Another approach utilizes the QGIS's native geoalgorithms. Let's assume there is a polygon layer called 'test', see the image below. Step 1. Use the "Extract vertices" Step 2. Apply the "Add X/Y fie …
Taras's user avatar
  • 34k
14 votes
Accepted

Copying coordinates under mouse to clipboard in QGIS

So, simply right-mouse click the map canvas > Copy Coordinate..., see the image below and get a pair of your coordinates as 9.115780774,48.813284425. …
Taras's user avatar
  • 34k
7 votes

Creating multiple separate vector lines from list of coordinate pairs in QGIS

Drag&Drop your CSV-file into QGIS, so you can see it in Layers tab Use a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer... with the following query SELECT make_line( …
Taras's user avatar
  • 34k

15 30 50 per page