Comments (7)
i think this:
SELECT p2.gid
FROM parcels p1, parcels p2
WHERE ST_Equals(p1.geom, p2.geom) AND
p1.gid <> p2.gid;
might be more efficient. will check the results against the other.
from bayarea_urbansim.
@janowicz @mkreilly Was the intention of stacking to group parcels that share an identical bounding box? That seems to be what the GROUP BY below does.
See: http://postgis.net/docs/manual-2.1/ST_Geometry_EQ.html
I will ask someone that knows more to double-check.
If not, then we could substitute with ST_EQUALS, which checks the identity of the entire geometry.
It seems to be a question of precision though, because ST_EQUALS can be subject to rounding errors.
from bayarea_urbansim.
The intention was, as you said, to group parcels with the same geometry.
Ah, good to know that group by geom means only that their bounding boxes
are the same!
On Tue, Jun 30, 2015 at 10:31 AM, Tom Buckley [email protected]
wrote:
= != =
—
Reply to this email directly or view it on GitHub
#53 (comment)
.
from bayarea_urbansim.
@janowicz ok well for posterity, the GROUP BY clause actually performs better for what the intention is. i think this is because of the rounding errors in st_equals. perhaps we should think about using the hash of the bounding box as an identifier in the future?
here's an example of that, for posterity. the stacked_not_identical (shown as brownish in here -- blue+red) parcels are parcels that are = (group by) but not st_equals (to some other parcel in the parcels table).
i'll leave this issue open because i do still wonder if we can improve that query.
from bayarea_urbansim.
this query produces very similar results and makes use of indexes. i'll submit a PR with it:
SELECT p1.* into stacked
FROM parcels p1, parcels p2
WHERE p1.geom && p2.geom
AND p1.geom=p2.geom AND
p1.gid <> p2.gid;
from bayarea_urbansim.
@buckleytom Thanks!
from bayarea_urbansim.
This pull request closes this issue:
from bayarea_urbansim.
Related Issues (20)
- json serialization TypeError: 1442 is not JSON serializable
- requirements file HOT 1
- version control for outputs (ipython notebook versions?) HOT 7
- version control for dependencies HOT 2
- Estimation.ipynb generates NA's in config parameters HOT 1
- How are configs written out by Estimation.ipynb? HOT 2
- misaligned lookup table values? HOT 4
- documentation should specify that the requirements of data regeneration are different from those of simulation HOT 1
- Confusing as a Service: debugging data regeneration processing tasks with different dependencies HOT 2
- data regeneration->estimation.py->nrh_estimate: no object named costar in the file HOT 2
- stable identifier for parcels "across runs" HOT 5
- Price model: spikes in future years for many HOT 1
- Slow HLCM estimation HOT 30
- Estimating a model with random subset of data? HOT 3
- getting changes from UAL HOT 2
- Incompatibility with UDST/urbansim PR #172 HOT 5
- accessory_units model step fails for simulation years not in 2010, 2015, 2020, etc.
- summaries.py fails with KeyError on jobs table
- issues related to the update to the new microdata
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bayarea_urbansim.