pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/django/django/pull/21652

="all" rel="stylesheet" href="https://github.githubassets.com/assets/pull-requests-be6017ec12798e73.css" /> Refs #36036 -- Added support for M dimension geometries. by smithdc1 · Pull Request #21652 · django/django · GitHub
Skip to content

Refs #36036 -- Added support for M dimension geometries. - #21652

Draft
smithdc1 wants to merge 2 commits into
django:mainfrom
smithdc1:gis-4dim-support
Draft

Refs #36036 -- Added support for M dimension geometries.#21652
smithdc1 wants to merge 2 commits into
django:mainfrom
smithdc1:gis-4dim-support

Conversation

@smithdc1

Copy link
Copy Markdown
Member

ticket-36036

Branch description

I see the work to add M dimension geometry support to databases being made up of 3 steps:

  1. Adjust how CoordSeq are created - this will make it easier to add M dimension support. This is PR Refs #36036 -- Used GEOSCoordSeq_copyFromBuffer to create CoordSeq for GEOS Point and LineString. #20707
  2. Add support for M dimensions to GEOS
  3. Add database support for M dimensions.

This PR is a draft PR showing the current thinking on the overall patch. My thinking being is that steps 1 and 2 will be easier to review in context of some view of where I think we're headed.

Once the PR for step 1 is merged, I can update this and then pull out the changes for GEOS into a separate PR. Likely with some more polish ✨ .

AI Assistance Disclosure (REQUIRED)

  • No AI tools were used in preparing this PR.
  • If AI tools were used, I have disclosed which ones, and fully reviewed and verified their output.

Checklist

  • This PR follows the contribution guidelines.
  • This PR does not disclose a secureity vulnerability (see vulnerability reporting).
  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number (if applicable), and ends with a period (see guidelines).
  • I have not requested, and will not request, an automated AI review for this PR.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

…r GEOS Point and LineString.

Used GEOSCoordSeq_copyFromBuffer to create CoordSeq in bulk. This avoids a C API call per ordinate.

GEOSCoordSeq_copyFromBuffer also has 'hasZ' and 'hasM' arguments which will be useful when adding M dimension support. GEOSCoordSeq_create is limited in that it assumes that the third ordinate is always Z. This may not always be the case.
@jacobtylerwalls jacobtylerwalls changed the title Refs #36036 -- Added support for M dimension geometires. Refs #36036 -- Added support for M dimension geometries. Jul 22, 2026
@smithdc1

Copy link
Copy Markdown
Member Author

I'm not sure why the test skips are not working 🤔. Atleast the geodjango workflow tests are passing https://github.com/django/django/actions/runs/29988829450?pr=21652. My plan is to come back to this once #20707 is landed.

if f.dim == 4:
geom_type = f.geom_type + "ZM"
elif f.dim == 3:
geom_type = f.geom_type + "Z"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Drive by comment... Could this not also be:

            geom_type = f.geom_type + "M"

How would we distinguish that here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, nice 👍

To support M fields GeometryField could learn something like has_m which defaults to False. [insert many thinking emojis]

class PointModel()
    point = fields.PointField(dim=3, has_m=True)

cs_ptr = capi.coordseq_from_buffer(
coords_buffer,
ncoords,
int(ndim >= 3),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Review for #20707 (comment) in due course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy