geocompx / geocompr

Geocomputation with R: an open source book
https://r.geocompx.org/
Other
1.59k stars 585 forks source link

Additional information about Table 5.1 regarding geometry conversions might be needed #1036

Closed tibbles-and-tribbles closed 10 months ago

tibbles-and-tribbles commented 10 months ago

In subsection 5.2.8 (https://r.geocompx.org/geometry-operations#type-trans), I think that Table 5.1 could use some additional information explaining the origin of the table cell values. These cell values represent the number of features generated by the corresponding conversion, right? But how do we know the number of coordinates in the original geometry?

Nowosad commented 10 months ago

Hi @tibbles-and-tribbles -- thanks for your comments. This part was heavily trimmed in the past. You can find some extended code at https://github.com/geocompx/geocompx.org/blob/main/post/wip/casting-geometries-extended.Rmd_. Do you have any suggestions how to make it better?

tibbles-and-tribbles commented 10 months ago

@Nowosad, the link in your comment didn't work for me.

Before Table 5.1 perhaps insert a list that describes the various single-feature sf objects as follows...

Let's say we have the following single-feature sf objects:

  • poi - POINT type (with one point by definition)
  • mpoi - MULTIPOINT type with four points
  • lin - LINESTRING type with five points
  • mlin - MULTILINESTRING type with two linestrings each containing ? points (I don't know how this particular cast works)
  • and so on...

Then replace the row names in Table 5.1 with the object names poi, mpoi, and so on...

I hope this suggestion helps in some way!

tibbles-and-tribbles commented 10 months ago

And, by the way, thanks for including so much detail in the book. Creating a table like this must be a lot of work, so I appreciate it!

Nowosad commented 10 months ago

That is the working link: https://github.com/geocompx/geocompx.org/blob/main/post/wip/casting-geometries-extended.Rmd_

Thanks for the suggestions -- I will try to work on them in the next few days.

Nowosad commented 10 months ago

https://github.com/geocompx/geocompr/pull/1040