Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query distinct features #1027

Closed
wants to merge 1 commit into from
Closed

query distinct features #1027

wants to merge 1 commit into from

Conversation

joelondon
Copy link
Contributor

@joelondon joelondon commented Nov 29, 2017

hello @jgravois here is the PR discussed on #1026 - the test is a work in progress, however the method itself appears serviceable on real data.

@joelondon joelondon closed this Nov 29, 2017
@joelondon joelondon reopened this Nov 29, 2017
@joelondon joelondon changed the title query distinct features, plus initial commit of a test query distinct features Nov 29, 2017
@joelondon
Copy link
Contributor Author

joelondon commented Nov 29, 2017

here's a little test on real data

const queryDuplicates = L.esri.query({url:'https://services.arcgis.com/rOo16HdIMeOBI4Mb/arcgis/rest/services/Neighborhoods_pdx/FeatureServer/0/query'})
queryDuplicates.where("1=1").fields('NAME')
queryDuplicates.run(function(error, featureCollection, response){
  console.log('Duplicates query (anticipate 130)', 'Found ' + featureCollection.features.length + ' features');
})

const queryDistinct = L.esri.query({url:'https://services.arcgis.com/rOo16HdIMeOBI4Mb/arcgis/rest/services/Neighborhoods_pdx/FeatureServer/0/query'})
queryDistinct.where("1=1").fields('NAME')
.distinct()
queryDistinct.run(function(error, featureCollection, response){
  console.log('Distinct query (anticipate 126)', 'Found ' + featureCollection.features.length + ' features')
})

@jgravois
Copy link
Contributor

in your own implementation, calling both distinct() and run() triggers two identical requests. i've fixed this (and your test) in #1028.

thanks for helping get the new feature landed!

@jgravois jgravois closed this Nov 29, 2017
@joelondon joelondon deleted the distinctQueries branch November 30, 2017 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants