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

Detail view contents are inconsistent on subsequent clicks #115

Open
brianashpugh opened this issue Jun 19, 2018 · 2 comments
Open

Detail view contents are inconsistent on subsequent clicks #115

brianashpugh opened this issue Jun 19, 2018 · 2 comments

Comments

@brianashpugh
Copy link
Collaborator

Sometimes if you click a data_point or data_polygon, it will fail to pull in the details from the underlying parcel. It seems that we rely on a mouseclick event on both layers to be triggered, but sometimes it fails to do so. We will eventually want to find an alternative way to handle this aggregation across layers.

One solution would send Carto some PostGIS SQL getting the parcel most overlapping with the selected point or polygon.

Generally, we're going to have to build out some way of fuzzily figuring out when two data points are the same parcel. This will also be useful for aggregating multiple data points added from the same parcel.

@calo1
Copy link
Collaborator

calo1 commented Jun 19, 2018

One solution would send Carto some PostGIS SQL getting the parcel most overlapping with the selected point or polygon.

I thought this is the current method we have. We pass some form of ST_Contain or ST_within
where there is survey data on top of parcel data

@brianashpugh
Copy link
Collaborator Author

brianashpugh commented Jun 19, 2018

I expected that but didn't see it anywhere in the code. The main part of the sql is below.

        // Build a background query string
        //
        let clauses = [];
        for(let key in datapoint) {
          clauses.push(key + ' = ' + datapoint[key]);
        }
        let sql = 'SELECT * FROM ' + tableName + ' WHERE ' + clauses.join(' and ');```

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

No branches or pull requests

2 participants