Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [code-review]

Questions requesting a review of working code should be asked at the Code Review Stack Exchange

1
vote
1answer
19 views

Using accumulate function for temperature units?

I am working on a piece of code that is designed to aggregate growing degree days for a particular region. To start, the equation for growing degree days is: Daily GDD (°F) = Daily Average ...
3
votes
2answers
47 views

ArcPy UpdateCursor deleting duplicate records?

I am working with .dbf files. I have two columns of data that have duplicates. A column of parcel numbers with duplicates and a column of letters that are duplicated. I want to delete all parcel ...
0
votes
0answers
109 views

Leaflet Mobile Performance (A Couple of Polygons)

I wrote a small Angular app with leaflet.js. In desktop browser scrolling and dragging speed is good but on mobile browser, performance is painfully. There are 8 polygon and 129 circle marker on the ...
1
vote
1answer
73 views

Reducing hourly rainfall data to monthly data for particular period of time and making a timeseries chart

I am working with GSMaP image collection (hourly rainfall data) in Google Earth Engine. I would like to make a script which is calculating and making a chart of sum rainfall in particular location ...
2
votes
4answers
77 views

More Efficient Conditional Statements - ArcGIS Field Calculator

I am new to Python and have successfully created the following statement that writes a change period value (01 or 02) based on the municipality and date fields. I am wondering if anyone could point ...
0
votes
0answers
68 views

Moving Feature Class to Different Feature Dataset within Same File Geodatabase using ArcPy?

I want to progammatically move a feature class into a different feature dataset within the same file geodatabase. I'm wondering if there is a way of doing this without including code to rename and ...
-1
votes
1answer
48 views

More Pythonic way to loop through UpdateCursor?

I have several sets of fields to populate based on other fields. The code below works, but I am wondering if there is a more Pythonic way to march through the i,j pairs? (Actual fieldnames are not ...
0
votes
2answers
27 views

Changing values in column based on another column in arcpy

I created new field in a table named 'Cimp'. Now I want to put there values that depends on values from column "COS_Cod" for example, if COS_Cod starts with 1.1 then Cimp is equal to 1. COS_Cod is a ...
0
votes
1answer
425 views

Fastest way to know in which section of line is a point

I have a line and a point. I want to locate where is this point in the line according to imaginary sections I make (any way I want). The output should be in which number of section is the point (...
0
votes
1answer
564 views

Fastest way to extract a raster in R (improve the time of my reproducible code)

I'm wondering if I have maximized the speed at which a mean of an area buffered around a point in a raster can be extracted. Fastest way I have ever found to extract a raster, with the pre-cropping ...
1
vote
0answers
40 views

Unable to get points in buffer on selected feature in QGIS using Python?

I have to create a 1.5 km buffer on each latitude/longitude of layer A. I would like to know how many points of line B will be inside the buffer of layer A. I used the following code but it takes too ...
0
votes
0answers
300 views

Speeding-up processing of pair-wise distance calculation in Python?

I am trying to do a cluster analysis using DBSCAN for my time series NDVI image in Python. I am using distance time warping (DTW) to measure distances between my time series. With this, I am computing ...
0
votes
0answers
109 views

Speeding up Euclidian distance estimation in raster using R?

I am estimating the euclidian distance in a huge raster with the package raster of R in Windows system. However, the processing takes a lot of time (in this case, more than 12 hours!). Is there any ...
1
vote
1answer
61 views

Counting only data points which are within a specified radius of other data points?

I wanted to know if I am on the right track here with what I am trying to do. I have two shapefiles, the first contains point data for all the businesses in DC and the other contains point data all ...
0
votes
1answer
133 views

Overview of available images per image collection?

I´m trying to make an overview in a table or graph of the available images in Landsat, Sentinel and Modis series for a certain area of interest. Although I could solve it as follows, this is obviously ...
1
vote
0answers
175 views

Finding a more efficient way to execute a long-run python script [closed]

I'm executing a python script which does these steps: iterates through 19 features (makes pairs "each one with each other", order doesn't matter: A-B = B-A) Creates Closest Facility Layer Adds ...
1
vote
1answer
180 views

Improving poor performance of ArcPy update cursor with ArcSDE and Editor? [closed]

I am using ArcGIS 10.5 in an ArcSDE environment. I have two tables, they are the exact same table schemas, but one is being edited and those edits are being pushed to the main table. I am a little ...
1
vote
0answers
41 views

Improve my arcpy script for simple querying [closed]

I am quite new to coding python in arcmap so I would like to get my code reviewed and hopefully improved. I have two Shapefiles, one contain polygons of cities borders and the other is points ...
-1
votes
1answer
209 views

Exporting attributes table from csv to spatialite file using PyQGIS?

I have this python script which allows me to convert delimited text file to spatialite . I used a loop to export attributes table to the output file and it takes over 2 hours when I execute the code ...
1
vote
1answer
191 views

Simpler Method to Map Fields in Spatial Join

I've cobbled together a script, part of which creates field mapping to sum fields in a spatial join. It took 13 lines of codes just to define which fields I want summed in the output. Is there a ...
0
votes
1answer
281 views

Route Layer with ArcPy and OSM Data - very slow

This is my first attempt at using arcpy: I have two CSVs which have columns: CSV1: join|id_a|lat_a|lon_a CSV2: join|id_b|lat_b|lon_b Each has got 100 rows of data. I would like to write a script ...
2
votes
0answers
139 views

How to speed up my script? [closed]

I am looking for the way to speed up my script. It is working fine, I mean, the final output is as required, but it is clunky and really slow. It is slow because of the double 'for..in..' loops, I ...
0
votes
1answer
1k views

Arcpy - Out of memory [closed]

I'm new at making scripts and I´m having some issues in my first arcpy script. I've created a code that automates maps creation, and it's running ok but gradually increases the memory consumption ...
6
votes
4answers
2k views

Optimising and speeding up ArcPy code? [closed]

Again my lines of surface runoff. I made a script, solving the issue when lines cross other lines. Something like generalization. Like on the picture below. The problem is that I have to solve 30 ...
1
vote
1answer
292 views

Improve Python script logic/structure for erasing features with arcpy

How can I define (and therefore, research/learn how to use) the Pythonic concept for writing a script that can take one input variable, compare it against a list of other variables, and then holding ...
28
votes
2answers
5k views

Using OGR and Shapely more efficiently? [closed]

I'm looking for some suggestions about how to make my python code more efficient. Normally efficiency doesn't matter for me but I am now working with a text file of US locations with over 1.5 million ...