|
POST
|
More accurate would to create a script (python), join the point to a location on the line and interpolate the Z values of the two vertices on both sides of the projected point, based on the distance to the point. Obviously you will have to take the distance of the point to the line into consideration. If the number of points is dense, you could create a TIN and then analyze that in relation to the Z-values of the line.
... View more
01-05-2015
02:23 PM
|
0
|
2
|
1682
|
|
POST
|
You will need to Reclassify data with floating values, since the combine tool requires integer data. Please include a screenshot of the data to show what your data looks like. You original post states that you have points, while in your last post you say you only have rasters...
... View more
01-05-2015
02:19 PM
|
0
|
0
|
2770
|
|
POST
|
Let's agree to disagree on your last remark. I've seen every version of ArcGIS starting from 8.x (and Arc/Info and ArcView before that) and each version change has provided me with some extra useful functionality...
... View more
01-04-2015
06:26 PM
|
0
|
0
|
2371
|
|
POST
|
If you would use this Con statement manually in the Raster Calculator, it would probably look something like: Con(inRaster < inputnumber1, 1, Con(inRaster > inputnumber2, 0, Con((inRaster >= inputnumber1) AND (inRaster<= inputnumber2), 0.5 * (1 + cos(3.14159 * ((inRaster – inputnumber1) * (inputnumber2 - inputnumber1)))), 0))) Since you're using ArcObjects, things will get a bit more complicated to nest the Con Statements. Maybe you can find some useful info here: ArcObjects 10 .NET SDK Help ArcObjects Help for .NET developers
... View more
01-04-2015
06:22 PM
|
0
|
0
|
814
|
|
POST
|
If you performed a Zonal Statistics as Table with the same zone information (polygons or raster) then the value column can be used as key to join the two tables.
... View more
01-04-2015
05:44 PM
|
1
|
0
|
1294
|
|
POST
|
That may indeed be the case (sometimes), but with each new version you get more functionality...
... View more
01-04-2015
05:36 PM
|
0
|
2
|
2371
|
|
POST
|
Small addition on what it actually does: line 15: it gets the start point (true centroid of the county, based on the FIPS) and the corresponding population of that county. line 18: it creates a dictionary containing the oid as key and a list of distance, population and fips of the counties as values line 21: the dictionary is ordered based on the distance from each centroid to the start county line 24: a loop is started to accumulate the population until the desired population is reached The result is printed as where clause that can be copied into the layer properties to see the result.
... View more
01-04-2015
05:35 PM
|
0
|
0
|
1254
|
|
POST
|
I am attempting to create a series of bivariate maps of an index of habitat suitability (point data) with elevation, slope, and aspect. Because there is no attribute table for any of the data, they cannot be joined. However, I am wondering how (if it is possible) to join and map the zonal statistics of the two datasets. I have zonal statistics of each one in the same format. Can they be joined in one file to show the unique values of both sets of data? the Join Field tool doesn't seem to work. Zonal Statistics is normally carried out on raster data. Slope, elevation and aspect are normally managed in raster format. You mention that the habitat suitability point data has elevation, slope and aspect, but no attributes. This confuses me a bit. If point data contains slope, aspect they will probably be stored as an attribute. Elevation could be stored as the z-coordinate of the point. Is it possible to include a screenshot of the situation (table of content and data)? That might explain what you are dealing with. The output would be a bivariate map of habitat suitability and elevation, another of habitat suitability and slope, and one of habitat suitability and aspect. So you want to investigate the relationship between habitat suitability and slope, elevation and aspect. If you split up the island in the areas, would these areas be representative for a habitat? You can use zonal statistics to obtain the stats per area of the rasters (slope, aspect and elevation). Another method could be to classify slope, aspect and elevation and use the combine tool (Spatial Analyst) to create a raster with the unique combination of the three classified rasters. If you analyze which combination is suitable you have access to the areas where this combination occurs on the island.
... View more
01-04-2015
05:21 PM
|
0
|
2
|
2770
|
|
POST
|
Is it an option to update to a newer version of ArcGIS?
... View more
01-04-2015
05:10 PM
|
0
|
4
|
2371
|
|
POST
|
Assuming you have the polygon of the island and know how you want to divide it into the 5-7 areas, you start editing the layer (or a copy of the layer). You find instructions here: ArcGIS Help (10.2, 10.2.1, and 10.2.2) If each area is supposed to have an equal amount of points, you will have to use something else. The Aggregate Points tool will probably not provide the desired result. This is more cartographic tool. You may need the Grouping Analysis or any related tools from the Spatial Statistics\Mapping Clusters toolbox...
... View more
01-04-2015
02:30 PM
|
0
|
4
|
2770
|
|
POST
|
Just because it is fun... ...using this code: import arcpy
import math
def main():
from collections import OrderedDict
# create ordered list of distance vs id + pop
fc = r"C:\Forum\NearEnhanced\gdb\pop_counties.gdb\counties"
fld_pop = "PST025181D"
fld_fips = "FIPS"
fips_start = "29189" # "05021"
max_pop = 5000000 # 1000000
# get start pnt and pop
pnt_start, pop_start = getPointStart(fc, fld_fips, fld_pop, fips_start)
# create ordered dict with distance, fips and pop
dct_data = createDictDistancesAndData(fc, fld_fips, fld_pop, pnt_start, fips_start)
# let's sort on distance to true centroid
dct_sorted = OrderedDict(sorted(dct_data.items(), key=lambda x: x[1][0]))
lst_fips = [fips_start]
pop_tot = pop_start
for oid, lst in dct_sorted.items():
pop = lst[1]
pop_tot += pop
if pop_tot > max_pop:
print pop_tot
break
else:
lst_fips.append(lst[2])
print "{0} in ('{1}')".format(arcpy.AddFieldDelimiters(fc, fld_fips), "','".join(lst_fips))
def getPointStart(fc, fld_fips, fld_pop, fips_start):
where = "{0} = '{1}'".format(arcpy.AddFieldDelimiters(fc, fld_fips), fips_start)
row = arcpy.da.SearchCursor(fc, ("SHAPE@TRUECENTROID",fld_pop), where_clause=where).next()
return row[0], row[1]
def createDictDistancesAndData(fc, fld_fips, fld_pop, pnt_start, fips_start):
sr = arcpy.Describe(fc).spatialReference
dct_data = {}
where = "{0} <> '{1}'".format(arcpy.AddFieldDelimiters(fc, fld_fips), fips_start)
with arcpy.da.SearchCursor(fc, ("SHAPE@TRUECENTROID",fld_pop, fld_fips, "OID@"), where_clause=where) as curs:
for row in curs:
pnt = row[0]
pop = row[1]
fips = row[2]
oid = row[3]
dist = getDistanceArcpy(pnt_start, pnt, sr)
dct_data[oid] = [dist, pop, fips]
return dct_data
def getDistance(pnt_start, pnt):
return math.hypot(pnt[0] - pnt_start[0], pnt[1] - pnt_start[1])
def getDistanceArcpy(pnt1, pnt2, sr):
pnt_geo1 = arcpy.PointGeometry(arcpy.Point(pnt1[0], pnt1[1]), sr)
pnt_geo2 = arcpy.PointGeometry(arcpy.Point(pnt2[0], pnt2[1]), sr)
return pnt_geo1.distanceTo(pnt_geo2)
if __name__ == '__main__':
main() The example is using county with fips 29189 and a max population of 5 million. Change lines 7 to 9 to indicate the featureclass with the counties and the names of the fips and populations fields. Change the settings on line 11 and 12 to indicate the fips to start and the maximum populations. The result is a print of the where clause you can apply to show the counties included in the selection. The code can be adapted to create a feature class with the counties. The code stops with the value before it passes the maximum population. This happens on line 27 to 29.
... View more
01-04-2015
10:11 AM
|
0
|
1
|
1254
|
|
POST
|
Most importantly is that you solved your problem. Looking at the graph it seems the order of the distance (horizontal axis) is what is causing the strange behavior)...
... View more
01-04-2015
07:51 AM
|
0
|
0
|
1200
|
|
POST
|
Good point... that is a little more complex and I'm not sure if you can convert the mosaic raster dataset to a raster object... This is what I did (and I corrected some errors in the code): import arcpy, os
from arcpy.sa import *
arcpy.env.overwriteOutput = True
ws = r"C:\Forum\rasCat\bla.gdb"
arcpy.CheckOutExtension("Spatial")
mosa = os.path.join(ws, "mosa")
dem = os.path.join("IN_MEMORY", "dem01")
arcpy.CopyRaster_management(in_raster=mosa,out_rasterdataset=dem,
config_keyword="#",background_value="#",
nodata_value="-3,402823e+038",onebit_to_eightbit="NONE",
colormap_to_RGB="NONE",pixel_type="#",
scale_pixel_value="NONE",RGB_to_Colormap="NONE")
ras = arcpy.Raster(dem)
dem_min = ras.minimum
dem_max = ras.maximum
print dem_min, dem_max
result = Con((ras - dem_min) >= 1000, 1, Con((dem_max - ras) >= 1000, 2, 0))
result.save(os.path.join(ws, "outras01"))
arcpy.CheckInExtension("Spatial") In the code: ws contains the path to the file geodatabase. mosa is the path to the mosaic dataset in the file geodatabase dem is a intermediate raster, result from converting the mosaic dataset to a raster (in memory)
... View more
01-04-2015
07:49 AM
|
0
|
2
|
2182
|
|
BLOG
|
Did not have the time to look into this yet, and I wonder if I will be able to get you a decent answer. Maybe some of the Python experts want to join in... Jason Scheirer, Jake Skinner, Curtis Price, Joshua Bixby, Filip Král... anyone?
... View more
01-03-2015
05:23 PM
|
0
|
0
|
649
|
|
POST
|
You could manually divide the island into these areas. But, why do you want to aggregate the points into 5 or 7 areas?
... View more
01-03-2015
02:01 PM
|
0
|
6
|
2770
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-09-2020 09:26 AM | |
| 6 | 12-20-2019 08:41 AM | |
| 1 | 01-21-2020 07:21 AM | |
| 2 | 01-30-2020 12:46 PM | |
| 1 | 05-30-2019 08:24 AM |
| Online Status |
Offline
|
| Date Last Visited |
Monday
|