Which operations must be performed using the Geoprocessing API in ArcGIS Pro?

I want to migrate .NET application from arcobjects to Arc GIS Pro SDK.
As I understand some operations such as creating tables and feature classes, creating and modifying fields need to be performed using the Geoprocessing API in Arc GIS Pro SDK.
Where can I find full list of such operations or more information about it?

Using arcpy.MakeFeatureLayer_management on Shapefile and Feature Class

The larger goal with this code is to create a temporary polygon based on the calculated coordinates (which it does), then to see if the polygon intersects with the “unobscured_FC”. After I run the select by location the polygon will be deleted, and all sorts of other hilarity will ensue. I only need the temporary polygon for the select.

Now, I’ve read that you can’t run arcpy.SelectLayerByLocation_management() on shapefiles or feature classes, which is why I tried to make feature layers from the two. However, despite that, I’m getting this error:

ExecuteError: Failed to execute. Parameters are not valid.
The value cannot be a feature class
ERROR 000840: The value is not a Raster Layer.
ERROR 000840: The value is not a Mosaic Layer.
Failed to execute (SelectLayerByAttribute).

I’ve searched thoroughly for an answer to this problem, and they all appear to be telling me that I need to do exactly what I’m already doing.

How am I failing here to make both of these into feature layers?

Code below…

unobscured_FC = r"C:example.gdbexample_FC"
arcpy.MakeFeatureLayer_management(unobscured_FC, "unobscured_lyr")

#These coordinates are calculated above in a code block I've excluded...
coordList = [[[Xmax,Ymax], [Xmin,Ymax], [Xmin,Ymin], [Xmax,Ymin]]]
point = arcpy.Point()
array = arcpy.Array()
featureList = []

for feature in coordList:
    for coordPair in feature:
        point.X = coordPair[0]
        point.Y = coordPair[1]
    polygon = arcpy.Polygon(array)    

tempShape = os.path.join(sys.path[0], "temp.shp")
arcpy.CopyFeatures_management(featureList, tempShape)
arcpy.MakeFeatureLayer_management(tempShape, "tempShape_lyr")

arcpy.SelectLayerByLocation_management("unobscured_lyr", "INTERSECT",   "tempShape_lyr", "", "NEW_SELECTION")

How to calculate WGS84 (EPSG:4326) area in C# or SQLGeometry?

I am not normally a GIS developer, I am just helping out with a bug and I am stumped on what is going on here, could I get some help please.

I have two calculations, one in 4326 (WGS84) and one in 3857 (Google Mercator). The coordinates were converted from 4326 -> 3857 and I have confirmed those are correct with ArcGIS and various online site conversion tools. The results I have are…



If I do an estimate of the area for 3857 by calculating the difference in the x and y points then multiplying the differences and dividing by 1 mil to get sq km, I get the result just under 16,000 sq km. Running SqlGeometry.STArea on a polygon bbox using these points this gives me a similar number.

If I convert the lat long to UTM I receive the numbers …



Excel Calculations
Easting         Northing        sq m                    sq km
719,510.3358    4,208,764.4633      
243,900.3520    4,432,069.0566  
475,609.9837    223,304.5933    106,205,894,001.5610    106,205.8940

Sites used to convert to UTM




Running the same calculation of the difference and the area gives me the result of 106,205 sq km.

The code currently calculates the lat long by doing the following on a polygon of the bbox …

SqlGeography geog = SqlGeography.STGeomFromWKB(aoi.STAsBinary(), (int)aoi.STSrid);
area = (double)geog.STArea();

This gives me about 9,600 sq km.

What I need to know…

I am trying to find out which calculation is correct. I am leaning toward 3857 being correct as I the calculations give me approximatly the same numbers no matter how I do them. Since I feel that 4326 is incorrect, I would need a better way to calculate this in the current application (uses C# and SQLGeometry). If someone sees an error in my calculations please let me know and how to do this better if so.

How does majority algorithm works in ArcGIS

I’m trying to understand how does the majority resampling works in ArcGIS, they write that

“The MAJORITY option, which performs a majority algorithm, determines the new value of the cell based on the most popular values within the filter window. It is mainly used with discrete data just as the nearest neighbor method; Majority tends to give a smoother result than Nearest.”

I am talking about the Majority Filter geoprocessing tool from Spatial Analyst extension.

What if there are two most popular values?

Is there a way to resample a raster if for example 50% is covered by a value?

Is it possible to connect to an Access db via ModelBuilder?

I created an OLE DB Connection in ArcCatalog Database Connections. If I right click on one of my db tables I can “Create a Feature Class > From XY Table” and continue with my data processing.

However, if I try to incorporate this step into a geoprocessing model (ModelBuilder) I can’t seem to access the tables through my .odc connection. See image.

Is there another way to those Access tables within ModelBuilder, or am I doing this wrong way?

MS Access version is 2010.ArcGIS version is 10.1. I connected to .accdb.

enter image description here

Spatial Join – Grid Containing Points, Display Highest Value Only

Sorry if this has been answered–I couldn’t find anything specific to my question, however.

  • I have a polygon grid layer and a point layer which contains numerical values (1-4)

  • I want to use a spatial join to colorize the grid based on the highest value point it contains.

  • I’d like to do it in modelbuilder if possible, so I can easily incorporate it into my workflow.

For example:

enter image description here

Let’s say the value 4 is colored red, 3 orange, 2 green, 1 blue.

In this example, the top left square would end up with a value of 4, the lower right square would end up with a value of 2, and the other squares would end up with values of 3.

Mean coordinate issue with multipart polygons

I’ve been using Mean Coordinates in QGIS to find weighted mean centers based on different attributes for the counties in a singular state of the US. However I have come across a problem in which the calculation is affected by the number of polygons within a shape.

For example in the attached image I have been trying to simply find the geographical mean center of the state of Maine (no weights). The center should be further north but because the islands towards the south act as attraction factors the star, which is the result, finds its way towards the south.

Is there anyway to fix/work-around this issue? Do I just have to delete all islands?

enter image description here

enter image description here

Points of LinearRing do not form a closed linestring – one point intersection

I’m trying to index geojson data using elasticsearch.

There is some kind of polygons that causing an error: “Points of LinearRing do not form a closed linestring”.

Looks like it happens because these polygons have intersection in one point:
enter image description here

Is there some way to index such polygons or fix it programmatically?

Create Centerlines of a Polygon Buffer Feature, ArcGIS 10.3

I have seen another method for this to create centerlines, but that involved splitting the line and deleting the line closures. This is a huge network and the time involved in that would be impossible.I was hoping there was another method that I could not find that someone would help me out with, possibly new with 10.3.
I have ArcMap Advanced with Spatial Analysis and 3D Analyst extensions.
Example of part of network below.

Copying attachments from one geodatabase to another

I have a file geodatabase that is a compilation of multiple file geodatabases with varying schemas.

Some feature classes in the original databases had attachments, however the attachment tables no longer exist in the new, combined geodatabase.

There is an “Old-ObjectID” field for features in the new geodatabase that represents the ObjectID of the feature as it was in the original geodatabases.

I would like to know if there is some way to re-relate the old attachment tables to the new ObjectIDs in the new geodatabase?

Question and Answer is proudly powered by WordPress.
Theme "The Fundamentals of Graphic Design" by Arjuna
Icons by FamFamFam