Quantcast
Channel: Forums - Geoprocessing
Viewing all 1952 articles
Browse latest View live

Polygon Attribute to Existing Raster

$
0
0
Hey community,

maybe a nooby question, but:
How can I extract values from a polygon to a raster (based on spatiality).
Spatial Join works just with vector features, but not as combinition....

Any hints?

Problem with ModelBuilder

$
0
0
Hello,

I work with ModelBuilder, on feature class present inside dataset in SDE.

See attachment please.

The model runs in this order:

1) COPY
2) COPY OF ENTITIES
3) DELETE ENTITIES
4) APPEND
5) CHANGE PRIVILEGES
6) ADD SPATIAL INDEX

The tool operates correctly to step 6).

At this stage, it returns me an error message. This indicates that someone is using the data and therefore step 6) can not be executed.

How can I solve this problem?
Attached Thumbnails
Click image for larger version

Name:	process_modelbuilder.jpg‎
Views:	N/A
Size:	55.3 KB
ID:	34322  

Near by Group between two different features

$
0
0
Hello,

I found this model on the ESRI blog: http://blogs.esri.com/esri/arcgis/20...6/nearbygroup/

This model finds the closest feature that has the same attributes as an input feature, within the same layer.

I would like to know if this model can be altered to find distances between points with the same attributes in two different layers, not just within the same layer. So, using the table below as an example, even if the point 1_input in the input feature layer is actually closer to the point 2_near in the near feature layer, the calculation would skip it and find the distance to the 1_near instead, since it shares the same Attribute X value.


Input Feature layer
Point ID Attribute X value
1_input A
2_input A
3_input B
4_input A
5_input B

Near Feature layer
Point ID Attribute X value
1_near A
2_near B

Any suggestions would be much appreciated

Problem with append tool in the model builder

$
0
0
Hey community,
I've one problem:
I have a feature class or dbf table with lot of fields and empty feature class or dbf table that I want use as schema. So I've made a model builder with Append tool but the tool produce correct geometry but some field are empty (there are not errors message) . If use append tool manually with the same files the tool produce correct geometry and the fields are all OK.
How can I solve this problem?

Thank you very much

Check Geometry (Data Management)

$
0
0
This tool doesn't seem to work any more. I have tried it on faulty geometry in both 10.1 and 10.2. I get an empty table.

I have attached a sample file which has 5 instances of the point (1,1) According to the documentation, this should be part of the check geometry output, correct?

I have also tried it on bow-tie polygons (that overlap themselves).

Thank you
Attached Files

shape convert into multiple shapefile based on attriubute

$
0
0
Hello ,

i have a polygon shapefile

i would like to be able to use a tool in ARC that will split the master Poygon into smaller polygons based on an Attrubite such as the district/state, country Etc

At the moment i making an defination query and showing 1 district at a time , then creating a layer from this.

I was wondering if there is a tool that will give me an out of several new shapefiles , potentially named after the attribute it has taken the name from

i am aware there is a split tool , but my company does not have this licence

Does anyone have any ideas ?

Thanks

Point To Raster Tool

$
0
0
Hello,

I am using the point to raster tool, summing by "theCalcField", and using a cell size of .85 degrees. So I expect a full blocky-style raster.

Why then does the tool create a raster as though each cell is considering values from outside it's own cell (as per many other spatial analyst tools)?

This is my command.
arcpy.PointToRaster_conversion(LOCATIONS, theCalcField, RASTER_LAYER, "SUM", "NONE", "0.85")

And an image of the raster:

Attachment 34391
Attached Thumbnails
Click image for larger version

Name:	Picture1.png‎
Views:	N/A
Size:	723.6 KB
ID:	34391  

How to fill in gaps in a USGS DEM

$
0
0
Hi,

Does anybody no how to fill in gaps in a USGS DEM? I imagine the best way is to interpolate the missing values from the neighboring
pixels. I believe there is probably a Raster Calculator formula. I have found a few in other forums but they never seem to work. This could be because they are done in older versions of ArcGIS, but I am not sure. I am working with 10.2. Any ideas? Thank you so much.

Tom

Feature Serivce is confused

$
0
0
I have an odd issue with my feature services/geoprocessing service. I have a feature service created so that a web user can make changes to points and polygons and it updates once the webpage is refreshed. The data goes into an SQL database. The SQL databases show the all the adds, deletes and edits, but when I look at the .mxd that created the feature service in the first place the points/polygons do show up but the attributes are empty when I select them from the Table of Contents. Even weirder when I select the point/polygon with the "identify" button in the mapviewer I get the information about them correctly. That just doesn't seem correct if the attributes are empty yet they show up on the mapviewer of my mxd. I am confused and any help would be appreciated. Thanks. Oh and I am using 10.2.2

Merge and Replace

$
0
0
I am looking to merge two polygon feature classes. Only intead of creating overlapping features I wish to replace one with the other where the two overlap? Is there a better tool for this. Or will the parameters of Merge_management allow for this?

Geometry Correction on shapefiles

$
0
0
Hi All,


I have published one geoprocessing service on my ArcGIS server manager 10.2, for correcting the geometry of any shapefiles.

Meanwhile, developed application using ASP.NET and ArcGIS API for JavaScript. Flow of the application is as given below,

1. Users will upload shapefiles to the application with upload file control
2. These shape files (with .shp, .dbf and .shx) will be copied to server
3. Once it is copied .shp file, javascript function triggerGP will be called with .shp file path as argument
4. triggerGP function calls geoprocessor task passing this .shp file path as input path.

i am able to pass input parameter to geoprocessing task, but i am getting below error.

ERROR 000314: in_memory\{6E458FA5-3C99-4A2A-80C0-86A4D5C3F006} is not a Shapefile or a feature class in a Personal or File Geodatabase.
ERROR 000314: in_memory\{6E458FA5-3C99-4A2A-80C0-86A4D5C3F006} is not a Shapefile or a feature class in a Personal or File Geodatabase.


i know geometry task takes .shp, feature class or .lyr as input.

Please help me how can i give .shp file content to gp task on from Javascript or C#.

Kindly reply here if you need more information on this to clarify me.

Thanks.

Automatically grouping shapefile based on name

$
0
0
Hi there ,

i m not sure if if have put this in the right forum. If you think it be better somewhere else please advise

i have a lot of shape files , which have a name a standard name.

The name shows the year , the company and catogery

Some examples names would be 1999_ford_2 , 1998_nissan_3, 2008_toyota_5

I Have lots of these shapefiles. i would like to have groups that show the company

At the moment i am making a group layer , putting the company name in

i was wondeirng if there is any way of making this process automatic .

Polyline and Polygon Intersect

$
0
0
Dear ArcGIS Geoprocessing community,

I would like to ask if a polyline lies on the boundary of 2 polygons, how will the intersect tool handle the output result? Will the polyline intersect both polygons or either one?

One example is a road link with residential landuse on its left and industrial landuse on its right. Will the road link intersect with the residential or the industrial polygon? Any reference link is much appreciated.

Thank you.

Joel

My Visual Studio project wants to use ArcGIS 10.1 debugger instead of 10.2...

$
0
0
How do I change the file path which is used as the debugger? It is looking for a 10.1 path and it isn't there anymore.

Output json from Geoprocessing script?

$
0
0
I do not see any way to make a 10.2 geoprocessing script return data in json format (no json option in output parameter data types). Is there some other multiple value data structure that a geoprocessing script can handle that I can use to output my data?

What I have tried, is setting the output parameter to multivalue with type "any value" and using this code:
Code:

results=arcpy.SetParameter(5,';'.join(record_list))
but it fails saying it is expecting strings because my data is a list of dictionaries not a list of strings.

My output data is in this format:
[{'layer': 'Wombat Habitat', 'value': '-999'}, {'layer': 'Purple People Eater Habitat', 'value': '7.65'}, {'layer': 'Cookie Monster Habitat', 'value': '3.03'}]

Background info: This was originally a standalone REST service which output json that was consumed by a Flex widget that I have rewritten as a Python script because previous versions are no longer supported for various reasons I won't get into here. I wrote the new Python version as a standalone RESTful service but was running into problems with ArcPy memory leaks, which would not matter if the script ended but are a major problem for a service that does not end. At this point I am trying to just make it into a Geoprocessing script to be published as a service and just modify the widget to consume from thatGP service instead of a normal standalone REST service because I am guessing the GP service will execute it as if it was a normal script which would end (therefore getting memory back). In case you are wondering about the memory leaks, I did try using del statements, with statements, and putting as much as I could in functions to free up memory but it just keeps growing every time the service gets called.

Thank you!

compare two raster and find which pixels were removed

$
0
0
Hi ArcGIS users,

Good Day!

I want to compare my two rasters: 1) a reference raster and 2) a raster that result from merging different rasters. What I did was to clip the reference raster with all the administrative boundaries (around 81 shapefiles) - so it produces 81 raster layers. Then when I compare the sum of the clipped rasters per province the number of pixel count were reduced (~200 pixels). So what I did was to merge again all the clipped raster so I can compare it with the reference raster. And as I initially suspect, there are discrepancy on the pixel count. I need to locate where are the pixels that were removed, but I cannot find an appropriate tool. can somebody help me on this?

Hope my query is clear!

Thanks,
-Leo

Problem with ArcToolBox in ArcGis 10.1

$
0
0
Attachment 34451

When I open a tool in ArcToolbox, it is not showing anything, and ArcGIS installed several times, and I have the same problem, what can I do?;

thank you very much
Attached Thumbnails
Click image for larger version

Name:	ErrorArcToolBox_1.jpg‎
Views:	N/A
Size:	116.5 KB
ID:	34451  

Geoprocessing service returning wrong raster

$
0
0
I have created a geoprocessing service that adds two TIF rasters in a specified area of interest, then copies this result to a PNG raster and returns it. It works as expected when I execute the tool from ArcMap, but when I execute the tool on ArcGIS Server (v10.1.0), it returns the TIF version of the raster. I can see the PNG is sitting in the scratch directory, but for some reason it's not being returned.

Can anyone spot a mistake in my code below?

Code:

import os
import arcpy
from arcpy import env
from arcpy.sa import *

# note: we're using os.path.join as a workaround for broken data source errors
debug_features = os.path.join('C:\Raster\scripts\Temp.gdb\simple')

# Set this to the folder containing all rasters
workspace = "C:\Raster\Data"

try:
    # Check out Spatial Analyst License
    arcpy.CheckOutExtension("Spatial")

    env.workspace = workspace
   
    # Get parameters
    aoi_layer = arcpy.MakeFeatureLayer_management(debug_features,'in_memory\features')
    raster_1 = "tmax_1.tif"
    raster_2 = "tmax_2.tif"
   
    # Extract only the area under the feature layer
    aoi_raster_1 = ExtractByMask(raster_1,aoi_layer)
    aoi_raster_2 = ExtractByMask(raster_2,aoi_layer)
   
    # Add two rasters
    out_raster = aoi_raster_1 + aoi_raster_2

    # Copy to png
    name = arcpy.CreateUniqueName("rastermath_output.png", arcpy.env.scratchFolder)
    arcpy.CopyRaster_management(out_raster, name,"DEFAULTS",
                          "","","","","16_BIT_UNSIGNED", "ScalePixelValue")

    # Set output param
    arcpy.SetParameterAsText(0, name)

except Exception as e:
    arcpy.AddError(str(e))

finally:
    arcpy.Delete_management('in_memory')

I cannot use the original TIF in a javascript MapImageLayer, so any advice or workarounds would be much appreciated.

Model Builder - Select, Select by Attribute, Calculate Field, and Coded Domains

$
0
0
Two issues:

1) I'm trying to build a model that will take the table of a feature class and replace certain values in the same feature class. Example:

I have [field] with values (coded domains) of -1, 1, 2, 3, 4, X. Every time the coded domain is -1, I want to replace it with X.

There are ~15 fields that I want to do this with. Currently I am using Select Layer By Attribute, however this seems to mean that I have to have the layer in the .mxd to use the tool, and I would ideally like to run it from catalog. If I switch to using Select then I get a new feature class of my selection which will not work because in the end I need the whole table (or maybe there is a way it will work that I'm just not aware of yet).

Is there another tool to use, or a code block that I can tweak (there has to be...) in the Calculate field tool to select the records I want to change? I'm pretty decent with programming logic, but syntax is another issue entirely.

2) I have a coded domain value of 001, stored as text. I want to create a variable paramater for the model where the input will be exactly 001 and this will be used to calculate the field value. The problem is that every way that I do this the field updates to 1... unless I enclose 001 in double quotes. I was hoping to use the variable for other calculations where the quotes are not neccessary, and it would be best if I didn't need to rely on the user to read instructions about putting this parameter in double quotes (plenty of headaches could be avoided). Any way to do this??

Problems with loading data to Feature Class

$
0
0
Hi,

I'm trying to add some point data to a point feature class. I'm loading the data to the feature class to add records. The idea is that the added records will take on the same fields as the existing feature class. It appears to do that, but I have fields for, Plotrow, PlotCol, X_Coord, and Y_Coord, that are coming up as nulls. I must be missing a step in this process but I can't figure out what it is??

Jess
Viewing all 1952 articles
Browse latest View live