Automated Extract Values to Points Process

763
2
04-20-2017 06:30 AM
TobiasKilian
New Contributor

Hi!

i've got two file-geodatabases. One stores multiple raster datasets, the other contains several Point Feature classes. What i am looking for is an automated process to extract the raster value to each Point of the Feature classes. There are exactly as many rasters as Feature classes and they have the almost the same Name. what i want to do now is to extract the values of the first raster to the Points of the first Feature class in the other gdb. after that, extract the values of the second raster to the second Feature class, and so on. i tried to manage this using the model builder and having a nested model with two iterators (one Feature class iterator and one raster iterator). They were then connected to the "Extract values to Points" tool. But it did not work. I also tried to write an python script but because of the fact that i'm relatively new to Python i couldn't manage this either.

Any suggestions of how to fix this?

Thanks in advance

0 Kudos
2 Replies
PanGIS
by
Regular Contributor

Hi Tobias,

I do not have an answer but I would like to understand too the workaround for this task, it is interesting.

Probably you should change the visibility into https://community.esri.com/groups/model-builder?sr=search&searchId=3c96c3b7-122b-4341-b948-7f47b50bf...

NeilAyres
MVP Frequent Contributor

If the 2 list of features and rasters sort in the same order you could make a zipped list like this.

>>> rasList = ["Ras01", "Ras02", "Ras03"]
>>> fcList = ["Fc01", "Fc02", "Fc03"]
>>> zipped = zip(fcList, rasList)
>>> zipped
[('Fc01', 'Ras01'), ('Fc02', 'Ras02'), ('Fc03', 'Ras03')]
>>>

With the 2 lists being created by ListRasters & ListFeatureClasses in each workspace.

Then iterate through the zipped list to do what you want to do.