POST
|
and_viceversa, thanks for this reply. I'm attempting to write this script now and see if this works. I'll come back and let you know. Thank you for this idea. I think I get it and it shows promise
... View more
05-02-2022
09:00 AM
|
0
|
0
|
750
|
POST
|
My goal is to write a script that randomly samples a desired number of inputted N raster cells of a certain raster value/classification, and that these sampled cells be at least a specified inputted distance apart. After assembling this sample, I would like to export the latitude and longitude of these sampled cells to a spreadsheet. I am using ArcMap 10.8 and I write in python with IDLE. I have a .tif raster file of a large area. The size of an entire country. It has raster cells that are small, 30 x 30 m with roughly 180,000,000 classified as 0 and 150,000,000 classified as 1. I would like to write a script where I input a number of points that I want to be randomly sampled out of the category I desire and that these points are at least a distance that I determine apart from each other. Let’s just say, I want 1000 points of the raster cells that are classified as 1 and that they are at least 5 kms away from each other. I’d want to acquire the latitude and longitude of these cells—I imagine the center of the raster cell will do, but such precision is not necessary as 30 x 30 m is already very detailed. Then I’d like to export the latitude and longitude of these points to a .csv file or an excel sheet. How is the best way to go about doing this? I’m imagining efficiency might be a bit of a problem. Right now, my thought process is this: make a new .tif of just the cells with the desired value/category (1 in this case). Randomly sample a cell, (not sure which tool to use). Put coordinates of sampled cell into some table (not sure which tool to use) Draw a buffer (5kms in this case) around sampled cell. Make new .tif with the buffer area around previously sampled point excluded from eligible points to be sampled. Repeat steps 2-6, 999 more times. Export table to .csv Does anyone have any suggestions on a better way? Also, does anyone know what tools I would be looking for to accomplish this task? Thanks a lot in advance for any wisdom that you may give.
... View more
04-28-2022
11:23 AM
|
0
|
2
|
847
|
POST
|
Hi all, thank you in advance for any help you could give me. I'm new here and may have posted this in the wrong place. I am unclear about what network database templates are and how I can use them. I've done a little poking around on google and youtube about this topic, but I'm still unclear. I am attempting to use arcpy with ArcGIS 10.7 to do a simple service area analysis--how far distance-wise through a road network is a place on the road network from any of the nearest of many facilities. However, the geographic scope of this effort is quite large and can be over entire countries--say all of Japan. What I currently have the idea to do is create a network dataset on a smaller area in ArcMap, then use arcpy to make a template of the of this network data set using the CreateTemplateFromNetworkDataset tool. Create Template From Network Dataset—Help | Documentation I would then like to use that template to create a network dataset for the larger area using CreateNetworkDatasetFromTemplate. Create Network Dataset From Template—Help | Documentation Specifically for this effort, I would like to make a network dataset and create a template of it for the Japanese island of Shikoku. Then I would like to use this template to do the service area analysis mentioned above for all of Japan. Is this possible? The code seems to work but I don't understand what is happening under the hood and I'm worried I might be missing something. I'd also like to know more about templates and schema's in general. For example, can I use the templates I create for this on Japan, on other countries? I know that part of a schema is the projected coordinate system. So as long as I determine that the projected coordinate system from the first template is suitable for the new area I want to do the service area analysis on, can I just use the same template? What else is or could be missing? Thank you for any possible help!
... View more
05-16-2020
03:32 PM
|
0
|
3
|
841
|
Title | Kudos | Posted |
---|---|---|
1 | 05-21-2020 03:02 PM |
Online Status |
Offline
|
Date Last Visited |
12-01-2023
02:52 PM
|