Create Definition Query

1040
5
Jump to solution
05-21-2021 12:22 PM
jaykapalczynski
Frequent Contributor

I am trying to figure out how to create a Definition query and run some code against those records

How do I create the Definition Query from the species name passed to this function?

Points = r"E:/xxxx/ArcGIS/Projects/UserFrontEnd/xxx@server.sde/TestLocations"

def unique_values(table, field):
    species = field
    expressionValue = "common_name = '{}'".format(species)

    # CREATE DEFINTION QUERY FOR COMMON_NAME
        Points Feature Class EQUAL TO the ExpressionValue
    # RUN SOME CODE AGAINST THE RESULTING RECORDS FROM THE DEFINITION QUERY
        Grab the resulting Point records and do something
        

 

 

0 Kudos
1 Solution

Accepted Solutions
jaykapalczynski
Frequent Contributor

OK I posted my solution on another post...

I think you all for your thoughts....it got me through this one....

I used a Select instead and then used those results to update the polygon with counts

https://community.esri.com/t5/arcgis-api-for-javascript/count-points-in-polygon-and-symbolize-on-num...

 

View solution in original post

0 Kudos
5 Replies
DavidPike
MVP Frequent Contributor

definition queries work on layers.  What's with the function with a table parameter? Am confused on the detail of this tbh.

0 Kudos
BlakeTerhune
MVP Regular Contributor

It's related to some preprocessing work they are trying to do for a JS app.

Count Points in Polygon and symbolize on number of... - Esri Community

0 Kudos
BlakeTerhune
MVP Regular Contributor

@jaykapalczynski I mentioned before that using Dissolve seems like it would get you the output you want. Have you tried that?

0 Kudos
jaykapalczynski
Frequent Contributor

Thanks, I will look at the dissolve...

I just do not see where I apply the Polygon Feature Class and the Point Feature Class 

0 Kudos
jaykapalczynski
Frequent Contributor

OK I posted my solution on another post...

I think you all for your thoughts....it got me through this one....

I used a Select instead and then used those results to update the polygon with counts

https://community.esri.com/t5/arcgis-api-for-javascript/count-points-in-polygon-and-symbolize-on-num...

 

0 Kudos