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

Update spatial_relationships_exercises.rst #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

grolls23
Copy link

I've updated the answer key to use Multilinestring instead of Linestring in the query identifying which streets Atlantic Commons joins with, and updated the answer key to include S. Oxford Street.

The existing answer key says moving from Multilinestring to Linestring saves keystrokes and that both methods describe the same shape but this isn't true, which is evident because the Linestring representation of Atlantic Commons doesn't join with South Oxford Street. Although the note above says we can no longer use ST_Touches(), ST_DWithin also provides incorrect results with the 0.1m buffer.

I think keeping the Multilinestring Representation is preferable, at least for this question.

Update Answer Key to
a) Use Multilinestring instead of Linestring in query
b) Show intersection with S. Oxford Street as reflected by street view image
@@ -83,14 +83,15 @@ Exercises
FROM nyc_streets
WHERE ST_DWithin(
geom,
ST_GeomFromText('LINESTRING(586782 4504202,586864 4504216)', 26918),
ST_GeomFromText('MULTILINESTRING((586781.701577724 4504202.15314339,586863.51964484 4504215.9881701))', 26918),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefered stripping off the extra precision, for ease of eyeballing.

@dr-jts
Copy link
Contributor

dr-jts commented Jan 24, 2024

I agree with this change. A likely usage scenario is that the user would just cut-n-paste the geometry from the first query into the second. So the format & precision of the geometry don't really matter - the key aspect is that it is the identical geometry returned from the query.

If this change is made then the following note should be changed as well.

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.

3 participants