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.

7
votes
4answers
188 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/...
6
votes
1answer
52 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 ...
6
votes
3answers
302 views

Finding the nearest agents to a customer using IComparable

I got a C# class: ...
2
votes
1answer
49 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 ...
10
votes
1answer
109 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 ...
0
votes
1answer
40 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 ...
5
votes
1answer
96 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 ...
1
vote
0answers
210 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 ...
4
votes
1answer
61 views

Simple API call to get geo info and exception handling with call limiting to 50 request per hour in Python

I'm looking for a code review of this python I wrote - this code reads the zipcode column value from csv and calls the api and brings back lat, lng, state and city info. It works fine and gives me ...
9
votes
2answers
140 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 ...
2
votes
1answer
40 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. <...
2
votes
1answer
51 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 ...
3
votes
0answers
842 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 ...
4
votes
2answers
125 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 ...
2
votes
1answer
60 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 ...
4
votes
2answers
2k 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 ...
7
votes
2answers
209 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 ...
2
votes
0answers
110 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 ...
1
vote
0answers
78 views

KNN search by distinct category in postgis/postgres

I have a postgres table, etablissements with millions of rows, and a geom (st_point) column , spatially indexed (using gist). I'...
1
vote
0answers
50 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 ...
1
vote
1answer
46 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 ...
4
votes
0answers
245 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 ...
1
vote
0answers
305 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 ...
4
votes
1answer
284 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: ...
7
votes
1answer
641 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 ...
1
vote
0answers
32 views

Efficient backend for finding nearby properties

I am thinking of building an app based on location for finding nearby properties around 15 km from the location of the user. I am a beginner in Django and for such use case I could code the following ...
8
votes
3answers
923 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 ...
4
votes
3answers
347 views

Methods for calculating the distance between Polish postal codes

Let's consider we are a company who sells our products for other companies. In the programme the actors are an Agency (agencies of our company, we have a few in the ...
3
votes
1answer
153 views

Set time zone from cookie

Is the set_cookie variable the correct way to signal that the cookie should be set? It does not seems pythonic to me: ...
-1
votes
1answer
36 views

Count buffered streets that intersect buffered points using PostGIS

PostgreSQL 9.5.1 with PostGIS 2.0 extension This first section creates an intersection (clip) of the streets from another polygon (MTC15), then it buffers the intersection: ...
-1
votes
1answer
37 views

Function to classify address as EU or non-EU

LeadDetails class: ...
3
votes
0answers
118 views

Get nearest driver from 2.5 millions of data using mongodb

I have created 2.5 millions drivers dummy data, in this case lets say the drivers are moving around in the city. The driver's document look like this : ...
4
votes
1answer
591 views

Laravel Pagination with haversine formula in it

I'm using the haversine formula to count distance from selected post-code to desired destination. I have the following scope in ...
5
votes
3answers
136 views

Haversine Formula in Clojure

I implemented the Haversine formula to calculate the distance between two (latitude, longitude) coordinates. I was wondering if it looks natural to Clojure programmers. What could be improved? <...
1
vote
2answers
118 views

Generate new latitude and longitude in decimal

I have created simple algorithm to generate the new Location from given latitude and longitude. ...
7
votes
1answer
197 views

Raster processing for climate change model

I am working on a project on how climate change may affect the development of spruce budworm larvae throughout each year (historical and projected) using different climate change models and emission ...
4
votes
1answer
2k views

PANDAS code for calculating distance between waypoints

I've written some python code designed to take a csv of waypoints for a series of trips, and calculate the distance of each trip by the sum of the distance between the waypoints. An example csv might ...
6
votes
1answer
146 views

Calculating areas of map features

I am developing a plugin for QGIS (a Geographic Information Systems) software which uses Python. I have calculated four areas of interest, it does this by identifying each feature on the map (called <...
2
votes
0answers
130 views

Reduce sample rate of GPS data based on distance between points

The algorithm needs to reduce an RDD[GPSRecord] based on the distance between several points, e.g. "give me only GPS records when the distance between them exceeds ...
2
votes
1answer
140 views

Arcpy script to check for TIFF files and add them to different lists

My script goes through sub folders in my main directory and based on a wildcard checks if a tiff file exists or not, if it exists then the file path is appended to the corresponding list. For example, ...
1
vote
0answers
69 views

Extract climate variables on species range from worldclim and save into CSV

My code is currently taking too long to extract climate variables from the worldclim dataset. I would like to download the climate data from the link and find the maximum temperature over my species ...
3
votes
1answer
107 views

ArcPy script to analyze land use in counties

We have written a Python script using arcpy modules. It is was written by Python beginners and many parts of the code are written in 'unpythonic way'. The goal is ...
14
votes
3answers
2k views

Find my colleagues

I recently finished the Using Databases with Python course. To figure out whether I really understood what was being taught, I build an application which does roughly the same but uses a different ...
2
votes
1answer
60 views

Zip code reduce function

My task is to write a function that would take an array of zip codes and spit out only the zip codes that do not qualify. A non-qualifying zip code will not exist in the database and does NOT have ...
3
votes
1answer
262 views

Clustering 16 million records in parallel

I have a dataset with 16 million rows and may increase upwards of 30 million. I am using the parLapply to run across three cores in R. But it's taking two days to ...
5
votes
2answers
550 views

Accepting user defined functions for custom map reduce functionality in C++

I am implementing map and reduce - style functions for processing geospatial raster datasets. I would like the ...
4
votes
1answer
183 views

Finding travel distance between airports

I have 2 nested for loops which i want to get rid of. Any thoughts? I am calculating distance between cities based on their longitude and latitude. There is a custom function ...
6
votes
2answers
6k views

Core location background update and upload to server

I want to upload a user's location to a server to send them a location-sensitive alert, so the location needs to be fairly accurate: ...
6
votes
2answers
461 views

Computing intersections of a Polyline and a line

I wrote a script to compute / interpolate the nodes of a Polyline at a given latitude, input_lat. It works for my purpose but I am wondering if there is a better, ...
9
votes
3answers
244 views

Composing QGIS expression based on a QGIS layer tree

I am developing a plugin for a GIS (Geographic Information Systems) software which uses Python. I have been using Python for over a year (on-off) and have the following code which works. It basically ...