Questions tagged [geospatial]

Geospatial pertains to the geographic location and characteristics of natural or constructed features and boundaries on, above, or below the earth's surface; esp. referring to data that is geographic and spatial in nature.

Filter by
Sorted by
Tagged with
5 votes
2 answers
69 views

Geospatial application in python using OOP

I'm working on a tool that performs some computations using elevations from a DTM file retrieved from a WCS service. These computations will be done on predefined regions of Europe. I'm trying to ...
stray_dog's user avatar
1 vote
0 answers
17 views

convert GPS coordinates to C-SQUARES at any resolution

a C-Squares encoder in Julia. FYI, C-Squares is a geocoding algorithm that assigns GPS coordinates to a spatial grid with a chosen resolution. Its specifications is here: https://www.cmar.csiro.au/...
simplyPTA's user avatar
  • 191
2 votes
1 answer
55 views

Interpolate raster value using Python

I'm new in coding. I have a shapefile (points) and some raster files. My purpose is get the values from all raster to point (each point will get value from 2 or 3 nearest cell,the value on the value ...
Long nguyen duc's user avatar
1 vote
1 answer
94 views

measure distance between two points in python

I'm working in a function that generates isochrones for a project of mine and I'm facing a bottleneck performing some distance calculations. Here is what I'm doing: ...
Franco's user avatar
  • 11
9 votes
1 answer
1k views

Geohash library in C++17

GeoHash library in C++17 no allocations and no std::strings. It uses fixed buffer GeoHash::buffer_t. optimized nearby search, if possible, it search 2x2 or 2x3 ...
Nick's user avatar
  • 1,572
4 votes
0 answers
51 views

Use XYZ data to create cross sectional profiles across beach terrain, using OS Grid

This might be a slightly long question, but I've recently been doing a bit of R&D on the data processing workflows within the company that I work at and it would be great to see if there are any ...
Adam Johns's user avatar
1 vote
0 answers
28 views

Python library to convert spatial data or DEM (digital elevation model) to dictionary

I would like to expand a library which converts a DEM (Digital elevation model) to values stored in a dictionary. This dictionary can be used to create a 3D terrain in Three.js. I made a Django ...
Kempie's user avatar
  • 201
1 vote
0 answers
96 views

Performance optimization processing 95,000+ NetCDF files (using xarray + dask)

I was told over at gis.stackexchange.com that this question would be a better fit here. I already have a working code but it is very slow and my hunch is that it could be optimized. The goal here is ...
Luc Rébillout's user avatar
1 vote
0 answers
95 views

convert GPS coordinates to C-SQUARES, resolution 0.05°×0.05°

This is a simple C-Squares encoder in R. FYI, C-Squares is a geocoding algorithm that assigns GPS coordinates to a spatial grid with a chosen resolution. Its specifications is here: https://www.cmar....
simplyPTA's user avatar
  • 191
4 votes
1 answer
2k views

find closest object via latitude and longitude and haversine distance

Given a pandas data frame containing objects with ids and latitudes and longitudes: ...
cs0815's user avatar
  • 673
3 votes
1 answer
596 views

Vincenty's distance Direct formulae numpy

I've refactored a function from the pygc library used to generate the great_circle. The Vincenty's equation below can be found ...
Jason Leaver's user avatar
0 votes
2 answers
113 views

Modify polyline vertices

I have an ArcGIS Arcade script that uses JavaScript syntax. The script loops through GIS polylines and updates a coordinate. The coordinate is called an "M" coordinate (aka a "Measure-...
User1974's user avatar
  • 198
0 votes
1 answer
170 views

Loop through polyline vertices and update coordinate

I have a Python 2.7 script that loops through GIS polylines and updates a coordinate. The coordinate is called an "M" coordinate (aka a "Measure-value"). M coordinates are similar ...
User1974's user avatar
  • 198
1 vote
0 answers
2k views

Great-circle distance in Java

Today's assignment states that I need to write a complete java program which will calculate the relative orthodromic distance between two sets of geographic coordinates declared by the user. When the ...
E's computer class's user avatar
4 votes
1 answer
165 views

Checking which polygon a set of coordinates lie inside

I have a massive set of latitude, longitude pairs. I also have a list of GeoJson formatted locations. I want to find out which location each pair of coordinates lies in. I have some code to do this, ...
TomSelleck's user avatar
2 votes
1 answer
53 views

Advice on taming a slow loop required for visualization of large GIS dataset

I'm working towards plotting a large GIS dataset of which I've shown a sample above of about 1/6 of the data. I'm happy with how quickly the data loads in, and bokeh...
BBirdsell's user avatar
  • 235
7 votes
2 answers
343 views

Parsing Addresses with GeoPanda's GeoDataFrame

Long time reader of Code Review with my first question. I'm self-taught and suspect this code can be improved. The project is really important to me and the team and I could really use the help. I'm ...
BBirdsell's user avatar
  • 235
1 vote
0 answers
54 views

code plots - spatial data

I am an absolute newcomer in R. For my bachelor thesis I worked with spatial data. I did many plots with the normal "points"-function. I already have my results, but would like to improve my code. ...
user216204's user avatar
3 votes
0 answers
50 views

Accurate && precise location data within a timeframe (session)?

Scenario A session would start & end within a time frame. Within this time frame, the device would be moving within a constraint environment. The movement would be extremely slow (slow-walking to ...
Filip's user avatar
  • 63
2 votes
1 answer
47 views

Reload polyline midpoints into parallel tables

I have an Oracle GIS database that has spatial tables. The records in the spatial tables have a geometry column that contains polylines. I've written a Python 2.7.16 script that calculates the ...
User1974's user avatar
  • 198
6 votes
2 answers
3k views

Angular control for inputting latitude and longitude with validation

I've built a custom control to handle user input in a human-readable format, but save in a machine-format. It needs to have input validation, and to convert UI-input to a base format. I'm interested ...
ANeves's user avatar
  • 2,882
1 vote
1 answer
83 views

Work order spatial query (Part 2)

Part 2: Error Handling (and anything else that can be improved) (Part 1 focused on general cleanup.) I received this comment in an unrelated post (thanks @Milton): ...Since it is obvious you are ...
User1974's user avatar
  • 198
6 votes
1 answer
157 views

Graphing refugee movements using plotly in Python

I've created a simple data visualization in python that shows the movement of refugees around the world. The code works but I feel it is a bit slow. it takes about 10 s (on my hardware at least) to ...
Jeremy Herbert's user avatar
6 votes
1 answer
237 views

Work order spatial query (Part 1)

Part 1: General Cleanup (Edit: Part 2 is here.) I have a script in a Work Order Management System (Maximo) that performs a spatial query. Details: Takes the X&Y coordinates of a work order in ...
User1974's user avatar
  • 198
4 votes
0 answers
173 views

Python program for address normalization and geocoding

This is a school project I have been working on. I have created a program utilizing Tkinter, and I was hoping to get some feedback on the way I have gone about things. I feel like it is pretty messy ...
Keagan McNew's user avatar
12 votes
5 answers
897 views

Converting Geographic Coordinates into Lambert2008 coordinates

This is part of a game made in Unity3D. I wrote this class to convert geographic coordinates into lambert 2008 coordinates based on this reference document: http://www.ngi.be/Common/Lambert2008/...
user1747281's user avatar
7 votes
1 answer
334 views

Get nearest major city of an image (using EXIF GPS data)

I am writing a program that will take images in a folder, get the GPS Coordinates (from the EXIF data), then return the closest "major city". (I define a major city as one with an airport, so ...
BruceWayne's user avatar
6 votes
3 answers
361 views

Finding the nearest agents to a customer using IComparable

I got a C# class: ...
CodeMonkey's user avatar
3 votes
1 answer
792 views

Aggregate Pandas Columns on Geospacial Distance

I have a dataframe that has 3 columns, Latitude, Longitude and Median_Income. I need to get the average median income for all points within x km of the original point into a 4th column. I need to do ...
krewsayder's user avatar
11 votes
1 answer
209 views

Convert British and Irish National Grid references to or from WGS84 geodetic coordinates

I've been using this wgs84togrid program for a few years. It converts in both directions between National Grid coordinates for GB or Ireland (beginning with a ...
Toby Speight's user avatar
  • 74.6k
0 votes
1 answer
52 views

Analyzing distances between clusters of orders [closed]

I wrote the Python class below, which does what I want it to do, but the data structure is a mess. Was wondering if there was a better structure I could use to get the same results but with better ...
Mike Sivalls's user avatar
5 votes
1 answer
156 views

Python toolbox for OpenStreetMap data

Background My project is a Python toolbox. This is my first bigger coding project and it took me quite some time to code this toolbox. I learned a lot from the start point to this day. I changed this ...
JuniorPythonNewbie's user avatar
4 votes
0 answers
903 views

Wrap location API in coroutines

In my app I need to query location and scan wifi periodically. To conserve power I need to change the rate dynamically, depending on the distance to the target. Also I want to wait for both ...
leonardkraemer's user avatar
5 votes
1 answer
87 views

Rate-limited geographic data lookup

I'm looking for a code review of this python I wrote - this code reads the zipcode column value from a CSV file and calls an API to retrieve lat, long, state and city info. It works fine and gives me ...
BlackCurrant's user avatar
10 votes
2 answers
238 views

Where is the most desolate place in Colorado?

The Story While flying a plane over the forests of Wisconsin a couple years ago, I thought to myself "If I lost an engine, I would be awfully long way from an emergency landing airport. I wonder ...
Steve V.'s user avatar
  • 203
2 votes
1 answer
95 views

ProcessPoolExecutor KMZ file search

I've written a script to look for coordinates in KMZ files. I've tried to speed execution up using the ProcessPoolExecutor. I'm quite new to Python, so any recommendations are more than welcome. <...
Blasco's user avatar
  • 783
2 votes
1 answer
67 views

Javascript class to geocode Dutch addresses

I am relatively new to javascript ES6, the code I've written is working fine. However I am curious if this would be the best approach. I am trying to write a reusable module that I can use in multiple ...
Titsjmen's user avatar
  • 158
3 votes
0 answers
2k views

Function to calculate distances and nearest points between 2 GeoPandas dataframes

I have 2 geoPandas frames and want to calculate the distance and the nearest point (see functions below) from the geoSeries geometry from dataframe 1 (containing ...
ad_s's user avatar
  • 131
4 votes
2 answers
140 views

Find SuburbName from latlong or location

I have create one class and interface for finding SuburbName based on Location or LatLong coordinates. My interface ...
Lalji Dhameliya's user avatar
2 votes
1 answer
152 views

Finding the nearest defibrillator exercise from CodingGames

For my first attempt at Scala I decided to solve a simple exercise on codingame.com. Based on a string input containing the user location, the defibrillators count and a list of defibrillators ...
Stud's user avatar
  • 786
7 votes
2 answers
9k views

Convert geodetic coordinates to geocentric (cartesian)

I'd like to retain as much float precision as possible without having to resort to specialized libraries so I need this code to work with only standard modules. I'm doing this in QGIS where ...
YeO's user avatar
  • 385
8 votes
2 answers
757 views

Function to find user's region based on GPS coordinates

I've made an algorithm/ function to get a user's region based on their GPS coordinates. It primarily looks for big cites and counties for the region and the state for the outer region eg. orange ...
Rachel Dockter's user avatar
2 votes
0 answers
141 views

Determine the country by an IP

EDIT: I have updated the code, if you have comments about the previous version of the code, please do post them anyway. The task is to determine the country by an IP. Provided programme queries two ...
John Snow's user avatar
  • 235
1 vote
0 answers
87 views

Writing a table of national park data

I'm working to produce a Lookup table using the Arcpy module that contains descriptive statistics for US National Parks. The original data, found in tbl, has 12 ...
Jason Matney's user avatar
1 vote
1 answer
93 views

vectorize 2D gradient with spatially varying bins

The following code takes in some values ssh and solves the equations for the geostrophic motion (slide 8 here). The main part of the code is the computation of the ...
shamalaia's user avatar
  • 255
4 votes
0 answers
365 views

Generate NDVI Rasters from USGS EarthExplorer Landsat 8

I've written the following using Python Dictionaries and Pathlib Module. I'd like to improve the first function: list_landsat_bands. I've created a list of file patterns to match, which I then use ...
Peter Wilson's user avatar
1 vote
0 answers
480 views

Log visitor info like latitude, longitude to a database

I am collecting each visitor information like ip, lat, longitude, referrer and language and save it into db, then in db I have column in table with counter that increment if user revisits the web site ...
Ciasto piekarz's user avatar
4 votes
1 answer
584 views

DBSCAN "region query" too slow; implement a tree?

My current DBSCAN in Python works...but its indexing is far too slow; its a linear scan: ...
pstatix's user avatar
  • 159
7 votes
1 answer
1k views

PANDAS nearest site algorithm

I have got CSVs full of property transactions in the UK from 1995 to 2017, separated by year such as "RS2015.csv". I have a 2nd CSV with a list of wind turbines in the UK. Both have coordinates in WGS ...
CTaylor19's user avatar
  • 173
8 votes
3 answers
2k views

Mask latitude text field

I have an input element on one of the pages. This input is supposed to take a string of digits from a user. In order to enhance UX I'd like to mask input's value at any given time. Like so: What came ...
askhat's user avatar
  • 123