4,934 questions
1
vote
1
answer
77
views
Issues reading in MODIS .hdf rasters with R's Terra
as title says I've recently encountered issues reading in a recently downloaded NASA MODIS file using R's Terra on OSX. Was following instructions in Luna documentation and tried installing Terra with ...
Advice
1
vote
1
replies
67
views
How to match noisy GPS data to a known route?
I have:
∙ A known running route as a sequence of lat/lon coordinates
∙ GPS observations from a runner (noisy, ~5-10m error)
∙ Timestamps for each GPS point
I need to snap each GPS observation to ...
0
votes
0
answers
69
views
Exporting CSV to GeoParquet with Duckdb while including the CRS
I have a dataset that comes from GBIF downloaded as a csv (see https://www.gbif.org/occurrence/search?occurrence_status=present&q=)
longitude = decimalLongitude and latitude = decimalLatitude.
I ...
Tooling
0
votes
2
replies
88
views
Small resolution changes in SpatRaster
I have two very large Spatrasters (exp1012 and exp1721) which I would like to stack over each other. However, their resolution changes slightly* so I cannot stack them into a single SpatRaster as they ...
Advice
2
votes
2
replies
144
views
Generating Random Polygons in R
I need help coming up with a spatial workflow in R, or to be pointed in the direction of a package or something, I have no idea where to start with this.
I have a raster called "Suit" (epsg:...
0
votes
1
answer
115
views
Compute Jaccard Index for two similar but not equal shapefiles in R [closed]
I have two distinct shapefiles that have a high degree of overlap, but aren't the same. I want to make a comparison and one of the things I would like to generate is the Jaccard Index of regions ...
Best practices
2
votes
8
replies
214
views
Intersecting very large shape files with thousands of multi-polygons
I have several multi-polygons shape files (the data is here https://habitats.oceanplus.org/, I don't have a way to provide direct downloads).
These shapefiles are anywhere between 200Mb to 1Gb and ...
0
votes
0
answers
63
views
Optimize point-to-border distance computations for large datasets in GEE
I have two datasets:
One of ~10,000,000 points (agricultural plots centroids), identified by a municipality insee_com and a unique ID id_prcl.
Another of ~100,000 municipalities borders (lines), ...
2
votes
0
answers
172
views
Performance issue with ST_CONTAINS
I have a performance issue with a query in MySQL. I need to compare location data and am trying to use ST_CONTAINS in a join. However, I am having a performance issue as it is quite slow, taking ...
0
votes
0
answers
43
views
How to map geoname ids to geoboundary shapeIDs?
I'm looking to map either wikidata ids or GeoName ids to geoBoundary shapeIDs for ADM1 and ADM2. I'm not sure if there is a straightforward way to do this.
For example, here is the GeoName entry for ...
2
votes
2
answers
124
views
Convert existing dataset to rioxarray object
I have a dataset that I need to convert into a rioxarray dataset so I can use regridding features but I can't work out how to convert an already existing xarray object to rioxarray.
Unfortunately I ...
0
votes
0
answers
67
views
Spatial join without Apache Sedona
currently I'm working in a specific version of Apache Spark (3.1.1) that cannot upgrade. Since that I can't use Apache Sedona and the version 1.3.1 is too slow. My problem is the following code that ...
6
votes
1
answer
234
views
How to fix invalid geometries in sf objects that st_make_valid() cannot repair?
I would like to find a way to fix broken geometries in objects returned by
rnaturalearth.
This reprex demonstrates invalid geometries in Natural Earth datasets
and explores potential solutions for ...
-1
votes
1
answer
282
views
How to merge many nearly parallel line segments into a single density-weighted segment (Python/Shapely)?
I have a dataset of line segments derived from many GPS traces, where users have followed the same roads but their paths aren’t identical (think of thousands of cars driving along a road, each with ...
0
votes
1
answer
52
views
Handling mixed datatypes in geospatial data in geotiff file format
I am working with Geotiff file which is 2 byte 2 channel image. I am trying to create third derived channel which is ratio of first band and second band. I am trying to save this band in Float32 ...
0
votes
0
answers
64
views
In ArcGIS Pro model builder, how do I pass number output of Get Field Value to an expression in Select Layer by Attribute?
I’m trying to automate the selection of polygons from a feature layer based on polygon area. Specifically, I need to select only those polygons whose area is greater than or equal to the median area ...
2
votes
1
answer
78
views
ST_Transform issue with MySQL
The spatial function ST_Transform returns weird results in MySQL. I tested the following query and compared with PostGIS and obtained very different results:
The query (exactly the same used in MySQL ...
1
vote
1
answer
101
views
Transformation of extent in data is not recovered when transforming back to the original CRS
I have an extent that I want to transform in order to change the ymax (i.e. limit the ymax to a new value):
library(terra)
# Set and extent
lulc.e <- ext(-830370, 787470, 117960, 2091060)
# ...
2
votes
1
answer
127
views
How to find the intersection between GPS points and land polygons using OpenStreetMap?
I have a dataset with thousands of GPS locations, part on land, part at sea. I'd like to identify these two groups using OpenStreetMap (OSM) data because of its high resolution.
However, OSM ...
1
vote
1
answer
139
views
How can I force longitude axis labels to display correctly with coord_sf() in ggplot2 (ticks at 160–180°E)?
I'm trying to plot a map of New Zealand using ggplot2 and sf, showing outer islands as well. I want the x-axis to show longitude ticks from 160°E to 180°E at 5-degree intervals, and the y-axis to show ...
1
vote
2
answers
136
views
How to combine spatial join with grouping data?
I would like to join two spatial dataframes based on the smallest distance between locations. However, I would like this selection to consider Year as well, i.e. each location in dat should be joined ...
1
vote
1
answer
176
views
Android ARCore Geospatial Device Movement
I started out using this sample project https://developers.google.com/ar/develop/java/geospatial/quickstart.
I am able to place the anchors and view them in the ar view and on the map view as ...
2
votes
1
answer
83
views
How to optimize MongoDB queries on a 2+ TB collection with \~50 billion documents?
I'm working with a MongoDB collection that stores around 5 years of historical hourly weather data. The production collection is approximately 2+ TB in size with about 50 billion documents.
To develop ...
0
votes
1
answer
98
views
How can I filter invalid WKT geometries before calling ST_GEOMETRYFROMWKT in Snowflake?
I am trying to convert WKT strings in a column to WKB in Snowflake using ST_GEOMETRYFROMWKT so that I can visualize them in Spotfire. Some rows cause this error:
ERROR [P0000] Geometry validation ...
0
votes
1
answer
86
views
Geowave or S2 index for squares and rectangles
Geowave, Geomesa and S2 Geometry offers a Hilbert index that seems suitable for a quadrilateral grid, with a unique 64-bit cell_ID per cell, for all grid levels...
However, I don't see how to use ...
0
votes
0
answers
46
views
Display fixed point using ARCore with GeospatialMode
I have a fixed point defined by (azimuth, elevation) = (0 NORTH, 10° above horizon), and I want this point to be displayed/visualize through the camera using ARCore when the camera is pointing in that ...
0
votes
0
answers
52
views
Why is ARCore altitude consistently inaccurate lately and where is Google support for ARCore?
I have been using ARCore Geospatial API to identify the horizontal and vertical position of a WGS84 Anchor I create during the session.
Before 2025, I was receiving a considerably good altitude value, ...
-1
votes
1
answer
63
views
I want to reduce cost related to a specific geospatial filtering
This is the following query :
SELECT
id,
x,
date_range_start
FROM table_a
WHERE ST_DWITHIN(point, shape_polygon, 30)
After running some tests, i can confidently say that WHERE ST_DWITHIN(...
0
votes
0
answers
58
views
Reduce memory usage in CDO collgrid command
I have 78 netcdf files each around 17MB, with shape (time=1, x=2048, y=2048) to be merged spatially. The single timestep is shared for all 78 files. The collgrid merge command below was able to ...
0
votes
1
answer
80
views
How to look up Geofence based on location coordinates with Amazon Locations Service?
I'm evaluating tools for geospatial storage and came across Amazon Location Service. The API docs show that there are operations for creating and managing Geofence objects. However, I don't see any ...
0
votes
0
answers
92
views
Error in saving a very large xarray dataset to zarr in python
I have global daily radiation data for 19 years. It is divided into one netCDF file for every day (so around 7000 files). I am loading all the files together as a single xarray dataset. This takes ...
0
votes
1
answer
83
views
MongoDB 2dsphere index error when one embedded document has an empty array for location
In my Ruby on Rails application, I have a User model that embeds_many :addresses. Each Address has a location attribute (an array representing coordinates).
I've created a 2dsphere index on the ...
0
votes
0
answers
60
views
Invalid offset for entity 11037970
I'm reading a polygon file using geopandas:
import osgeo
import geopandas as gpd
polygon_path = "F:\\data\\LPJP\\gwl2020_ch\\gwl_2020.shp"
polygon = gpd.read_file(polygon_path)
print(...
0
votes
1
answer
180
views
R Convert a list of polygons into a shapefile, where each polygon is a feature of the shapefile
I'm trying to convert this list of polygons, named all_buffers, into a shapefile. I'd like each polygon to be its own feature in the shapefile. Everything I've tried has only exported one single ...
0
votes
1
answer
93
views
Converting user-drawn polygons on a Cartopy map to a binary mask in Python?
I'm trying to make a program using Tkinter, Cartopy and Matplotlib that would allow users to draw polygons on a map. Once the polygon is closed (right click), I want to convert it to a mask where ...
3
votes
1
answer
137
views
Why is my MCP giving me an area size that is too small?
This is my first time doing any spatial statistics and I am slowly learning. I have seen a few other people here with similar problems, however none of the answers seemed to work for me.
I am trying ...
1
vote
2
answers
156
views
Detecting Overlapping Coordinates in Two KML Files Using JTS (Alternative Libraries?)
I am working with two KML input files and trying to determine if their coordinates overlap at any point. I am using the JTS Topology Suite (JTS) for spatial operations, but I am not getting accurate ...
2
votes
1
answer
176
views
How to align sf grid with polygon in R?
I am trying to use sf's st_make_grid to create a 20x20m grid over my study area (an agricultural field):
library(sf)
library(ggplot2)
# file below can be downloaded from:
# https://mega.nz/file/...
0
votes
1
answer
184
views
Failing to initialise a new USGS API instance
I have an account on the USGS and when I try to create an API instance using this code
from landsatxplore.api import API
import os
# Your USGS credentials
username = '<username>'
password = '&...
1
vote
0
answers
38
views
Handle warning of "Array is wrong shape or size" when plotting a geopolyshape and setting the ColorData field in MATLAB
MATLAB is throwing a warning and not plotting a geopolyshape when setting the ColorData field; however the shape is plotted when ColorData isn't set. The example code below demonstrates the issue. I ...
0
votes
0
answers
51
views
MySQL check if polygon lies within a feature collection
I have a column in my MySQL table for storing GeoJson data. It stores the feature collection of a polygon in a map. Now I want to search the table based on another polygon feature collection and get ...
8
votes
4
answers
413
views
Averaging or combining multiple superimpose spatial lines with sf
I have gps data of multiple passages over the same road segment. I want to combine them into the best estimation of the real road location under. Is there a way to do that in sf (or other R packages ...
1
vote
1
answer
78
views
segment-geospatial installation breaks jupyter lab in Ubuntu
I would like to install jupyter inside a conda environment and then install segment-geospatial, a python library from samgeo.
However installing segment-geospatial breaks something that causes jupyter ...
1
vote
1
answer
95
views
Remove unwanted graticule lines on globe with geom_sf()
The following code creates graticule lines for the opposite side of the earth. How can I suppress just those lines, but not all graticules?
library(tmap)
library(sf)
library(dplyr)
library(ggplot2)
...
0
votes
1
answer
105
views
R: Error in x[[jj]][iseq] <- vjj : replacement has lenght zero (Library SpatialML::rgf)
I am trying to run a geographically weighted random forest classification using the function SpatialML::rgf(). However, I am encountering the following error:
'Error in x[[jj]][iseq] <- vjj : ...
1
vote
0
answers
54
views
Is there a way that I can spatial join two line features without any common column in ArcGIS pro
I have been doing a spatial analysis. I have two regions, A and B, and I want to determine whether the roads crossing from A to B maintain the same classification or if the classification changes.I ...
3
votes
0
answers
149
views
Rotate a R plot with package sf [closed]
Edit: Including the hint from @Friede to the post where a geospatial plot is turned by changing the projection.
When I plot the following polygon, it is tilt 12.7° towards west:
library(sfheaders)
...
1
vote
2
answers
200
views
How to use st_buffer to shrink a multipolygon sf object?
I'm using the GeoJSON data for school district boundaries found here: https://data-nces.opendata.arcgis.com/datasets/nces::school-district-boundaries-current/explore
I'm trying to find the most ...
2
votes
1
answer
120
views
Trigger update on Postgresql/PostGIS table
I am working in a Postgresql database with PostGIS.
I need to automatically populate a PostGIS column with the intersection of another column's geometry and a landmass polygon. The current trigger ...
-1
votes
1
answer
72
views
Vector polygons from aerial orthophotography
I frequently create ortho mosaics from drone photos, then manually have to trace them to create vector habitat polygons.
Is there any software that can do this (preferably command line)? I do not ...