Questions tagged [spatial]
Spatial data types store geometric data, that is data related to an object's position in space.
3,169
questions
0
votes
0
answers
13
views
coordinates are recorded well in the data table but when I transform them with st_as_sf they are not converted well
data table plants_noFD coordinates
the resulting map with wrong coordinates
So, my problem is that the Northing coordinates are placed close to the equator (< 1°N in decimal degres) instead of ...
0
votes
1
answer
21
views
Reading a grib2 dataset without loss of metata with R
My question follows this previous question, that has been partially answered : Reading a grib2 dataset with 4 dimensions and 2 variables with R
I am trying to read a GRIB2 file with R. This file is a ...
0
votes
0
answers
18
views
extract raster values into each polygon in a shapefile in Python
I have a Gtiff layer and a shapefile with 5 polygons that are placed across the Gtiff (both have the same crs). I'm trying to create a NumPy array for each polygon that contains the pixels that are ...
0
votes
0
answers
27
views
STContains returns points OUTSIDE polygon. Should return points INSIDE polygon
I have this very long jupyter notebook
#!/usr/bin/env python
# coding: utf-8
# In[1]:
#Setting Environment
from ipyleaflet import Map, basemaps, Marker, Polygon
import pyodbc
import json
#Getting ...
0
votes
1
answer
25
views
How to get data using the rerddap function in library(griddap) when longitude is c(-180, 180) but the griddap dataset longitude is 0-360°?
The griddap function in the library(rerddap) in R provides an excellent function for accessing satellite data from ERDDAP Servers in a simple and straight forward way. Below is a reproducible example ...
0
votes
1
answer
27
views
Plotting geographic data with geom_sf()
I am trying to learn (or more specifically, remember and learn to implement) spatial data analysis in R. I am having some elementary difficulties with manipulating geographic data, which get in the ...
0
votes
0
answers
52
views
Comparing and combining two R sf objects
I've created two different types of percentage blue-green coverage at a 250m grid for Helsinki, Finland. One is based on Corine landcover data (i.e. https://land.copernicus.eu/pan-european/corine-land-...
0
votes
0
answers
22
views
Ef Core Relation With custom query
I want to create entity relations without foreign key using a custom query. Take look at my models:
class Track {
[Key]
public int TrackId { get; set; }
public NetTopologySuite.Geometries....
0
votes
1
answer
23
views
find average trajectory of movement vectors in R
I have a bunch of movement vectors with a direction (compass angle from 0-360), and velocity (km/hour, for example), and I want to summarize them into one average vector, and I can't seem to find a ...
0
votes
0
answers
22
views
How to identify intersecting polygons excluding borders [closed]
I am trying to identify overlap between public school districts and state legislative districts (i.e., which legislative districts are included in a school district's boundaries or vice versa). I ...
0
votes
0
answers
21
views
How to change the number of column of raster data in R?
I have two raster data, both have same resolution and origin. And both have 3600 columns.
I use r <- rotate(r) on one raster data to change the log from 0,360 to -180,180. but after this process, ...
0
votes
0
answers
22
views
How to perform band math and add extra bands to tif with rioxarray
I'm trying to work out how to open a raster, determine the name of the existing band(s), then use that bands value in math to create a new band.
I believe the data is being loaded to a DataArray. I'm ...
0
votes
0
answers
56
views
Is it possible to read head tracking data from Pixel Buds Pro?
The latest firmware updates on Pixel Buds pro have enabled head tracking for spatial audio. Do you know if Google offers an API in Android to read data from the PixelBuds IMU (i.e. angles/orientation ...
0
votes
1
answer
26
views
MCAR (Multivariate Conditional Autoregressive) model in R
I am performing a spatial analysis of student grades according to their city of origin using R. I have several covariates such as poverty, education and socio-cultural indices. So far I have fitted ...
1
vote
0
answers
20
views
How to eliminate no-neighbour data when doing spatial clustering
Hello wonderful people!
I'm trying to run a cluster analysis on some data that I've mapped on a choropleth map. It's the % participation rates per constituency.
I'm trying to run a Moran_result test, ...
0
votes
1
answer
40
views
raster::gridDistance() fails on medium to large raster files
I have some moderate sized raster files (max size ~190 MB) that I would like to calculate grid distances for using raster::gridDistance()
I'm finding that the operation is slow and/or R crashes for ...
0
votes
0
answers
24
views
SQL Spatial filtering - by DB query or by code
I have a SpringBoot application with MariaDB/MySQL database, and I want to know what is the best approach when using Spatial Data in the DB.
I have a SQL database with a table of Cities. Among other ...
0
votes
2
answers
43
views
Plotting RasterLayer objects using ggplot
I am incredibly sorry, but I feel like there aren´t good example datasets for this question, and thus I will not be able to prdocue a reproducible example. If this makes this question untenable then I ...
0
votes
1
answer
42
views
Change color scale based on value in R
I made a spatial plot with color scale from -100 to 100. But the condition is that the value which I plotted have range from -100 to 1500. The result is the values which more than 100 depicted by ...
0
votes
0
answers
15
views
want to unite attached spatial lines onto single line
I've created lines from unite spatial points. I want to unite attached lines into a single line and then number the lines based on their spatial position. Is the a way to do this in R? Follows the ...
0
votes
0
answers
11
views
Why does SDO_LRS.CONCATENATE_GEOM_SEGMENTS_3D zero out the Z index?
Please look at following query (run on Oracle 19c):
SELECT SDO_LRS.CONCATENATE_GEOM_SEGMENTS_3D ( MDSYS.SDO_GEOMETRY( 4402, 4327, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 2, 1), MDSYS.SDO_ORDINATE_ARRAY(-87....
0
votes
0
answers
30
views
How does Spatial Dropout work in the inference compared to Dropout?
I would like to deploy a trained Keras model on a microcontroller. However, there is no support for Spatial Dropout layer. I thought about removing the layer from the graph similarly to the Dropout ...
0
votes
0
answers
53
views
Intersecting lines with a circle after polar coordinates conversion
I have a dataset in polar coordinates.
The dataset contains the coordinates of points that I cast in lines.
Then I want to intersect these lines with a circle. From the polar coordinates, you can see ...
0
votes
2
answers
58
views
Specifying layers when using rast(..., type=xyz) to convert data.frame to SpatRaster in the terra package (R)
I have a simple csv file with lon/lat/time/values columns:
df <- data.frame(longitude=rep(c(10.5,11,12),10),
latitude=rep(c(10.5,11,12),10),
date= as.Date(rep(c("2012-01-01", "...
1
vote
1
answer
51
views
Asymmetric color scale with colorRampPalette in R
I have a problem to fill my color bar scale. Since my values are not in symmetrical from -85 to 15 with interval 5, I want to have red color for the positive values and blue color for the negative ...
0
votes
1
answer
57
views
How to Calculate Avg of Metric within Radius on Map
I am working on a problem that uses data that resembles the following snippet:
name = c('A', 'B', 'C', 'D', 'E','F','G','H','I','J')
lat = runif(10,min=37,max=39)
lon = runif(10,min=-91,max=-89)
...
0
votes
0
answers
16
views
How to calculate Moran's I and GWR when given duplicated factor data
I'm trying to do the statistical analysis by using the Moran's I, but it leads me into a serious problem.
Suppose the data look like:
y
indep1
indep2
coord_x
coord_y
District
y1
indep1 1
indep2 1
...
0
votes
0
answers
9
views
Why does SDO_AGGR_LRS_CONCAT_3D clip (zero out) the third dimension in the resulting geometry?
Doing:
SELECT SDO_AGGR_LRS_CONCAT_3D(SDOAGGRTYPE(
SDO_GEOMETRY(z.SDO_GTYPE, z.SDO_SRID, z.SDO_POINT, z.SDO_ELEM_INFO, z.SDO_ORDINATES),
0.005))
into l_geoloc
...
0
votes
1
answer
42
views
get nearby users using spatial index mysql
I have more than 20K users in the user's table and I have implemented a query that shows 10 nearby users at one time. I have tried this
EXPLAIN SELECT *, ( 3959 * ACOS( COS( RADIANS(42.29297046302411) ...
0
votes
0
answers
39
views
Join series of ordered single lines into one single line in Oracle Spatial
Have a series of ordered geometries (lines) of type:
MDSYS.SDO_GEOMETRY(4402, 4326, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 2, 1), MDSYS.SDO_ORDINATE_ARRAY(-87.5652173103127, 41.6985300456929, 0, 510.1408, ...
0
votes
2
answers
53
views
How to extract values from stacked raster layers(asc format) to occurence(csv) data?
#Loading climate data
bio6 <- raster("bio_06.asc")
bio5 <- raster("bio_05.asc")
predictors <- stack(bio5, bio6) predictors`
#Loading occurrence data which is in long and ...
0
votes
0
answers
9
views
Writing spatial file to Oracle database using R?
I'm trying to write a spatial file to an Oracle database using R, but I keep getting an error. The error message doesn't provide much information, so I'm not clear what the issue is. I'm not even too ...
0
votes
1
answer
31
views
Trying to find neighbouring buffers in R with poly2nb()
I want to get a list of neighbours for each buffer. However the returning nb list is empty.
require(sf)
require(spdep)
us <- tidycensus::county_laea
us <- st_sf(county_laea) %>% ...
1
vote
0
answers
22
views
spatio-temporal dataset - STFDF
I realise this code
Prov <- read.csv("Data.csv", header=TRUE)
dates <- as.POSIXct(Prov_CS$date, format = "%Y-%m-%d")
stations <- read.csv("stations.csv", header=...
0
votes
0
answers
28
views
Clustering geospatial data on equal distance coordinates but with a non spatial feature which can be used as weight for distance
I have a dataset that looks like this. It has an equal distance of 180x360 (latxlon) coordinates at one-degree resolution with an additional column for value at each lat-lon pair which is unique (...
0
votes
0
answers
13
views
Patch Merging and Pooling layer difference
I want to ask what the difference between Patch Merging in Swin Transformer and Pooling layer (e.x. Max Pooling) in CNNs. Why do they use Patch Merging instead of Pooling layer.
I understand that ...
0
votes
0
answers
44
views
How to insert OGR Feature into SQL Server database by GDAL C#
I want to insert GDAL OSGeo.OGR feature into my SQL Server database. I make a connection to SQL Server and retrieve some features from table by GDAL OGR and I want to insert these rows (Geometry) ...
0
votes
0
answers
28
views
How do I ungroup an sf dataframe with multiple sfc_POINT geometries to retain only 1 geometry column?
I have an sf dataframe (sfc_POINT geometry) made from 2 other sf dataframes (also sfc_POINT geometry). I want my final sf dataframe to have a single geometry column for a clean dataset for analysis, ...
1
vote
1
answer
22
views
Using Map on Function if name of df lists match
I have given a
a namend vector col:
col <- c(id = "CLUSTER", x = "LONGNUM", y = "LATNUM", n = "Severely.stunted.child.under.5.years..Total", pos = "...
1
vote
1
answer
54
views
Spatial Join in SQL Server
I come from a mining and exploration background. I have a list of points (with ID and X and Y coordinates).
Example
I have another table which contains polygons (claim numbers).
I am trying to find ...
0
votes
1
answer
33
views
WinBUGS Error - What is my "undefined variable"?
This is my first time running WinBUGS. My model is fairly simple, with only an intercept and two random effects. However, when I run the model I get a whole list of errors (see below). The first error ...
0
votes
1
answer
30
views
Extract biogeographical genions based on coodinates
I would like to extract the biogeographical for each sample sites based on the coordinates (i.e. latitude and longitude)
Searching through different resources I found a code that might work, ...
0
votes
1
answer
38
views
Adding decimal coordinates to a map with ggplot2 and GADM data
I'm trying to plot a map of France and then show where Paris is.
So with the code below, I can plot a map of France.
library(dplyr)
library(ggplot2)
library(ggsn)
library(here)
library(readr)
...
1
vote
0
answers
40
views
Why is MySQL Database not using my spatial index?
In my setup I want to use a spatial index to search efficiently through a database, in particular to get all points in a radius around a second point. However, I'm kind of confused, why MySQL (version ...
0
votes
1
answer
51
views
In R: Finding latitude and longitude of centroid given ONS LSOA code
I've got a dataset with ONS LSOA codes (e.g. LSOAstring="Westminster 018B", LSOAcode="E01004735") and want a lookup function that gives the latitude and longitude of the LSOA's ...
0
votes
2
answers
119
views
How would I draw hexagonal grid using H3 in Javascript?
I want to make a system where a user will be able to draw a hexagonal grid. The regions and their coordinates will be stored in Database. We are thinking to implement H3 libary for this. How will be ...
1
vote
1
answer
58
views
R Shiny interactive/reactive polygon selection and manipulation
I am working on a shiny app, in which I would like to enable the user to classify polygon triangles based on selected colors and save it along with the color as grouping variable to a new data frame ...
0
votes
1
answer
81
views
When performing spatial operations on raster, terra is replacing values outside of INT1U range with NA
I'm working with the Biophysical settings raster data set from landfire.gov. When I initially read in the data set with terra::rast(), everything appears to be working. However, when I attempt to ...
1
vote
2
answers
63
views
Extract function in terra package R gives memory usages spike?
I am trying to run terra::extract to sum population (from a .tif) to global regions (from a .shp). Below is a reproducible example of the code that I run. In the case below, the memory use before (A) ...
1
vote
1
answer
45
views
R terra plot vector error subscript out of bounds and no legend or axes
I import a vector:
library(terra)
v <- vect("my file")
plot(v)
works fine
plot(v,1)
returns
Error in g[[i]][[j]] : subscript out of bounds
and then successfully plots v, 1 as expected, ...