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

add postgis geometry as valid column type #140

Conversation

staffanhedstrom
Copy link
Contributor

@staffanhedstrom staffanhedstrom commented Aug 16, 2024

This small pr simply also adds the PostGIS geometry type as a valid Type when creating a column.

table.AddColumn<Geometry>("geom");

Will now correctly create the type. Note that if the PostGIS extension is not enabled you will run into errors.

@mysticmind
Copy link
Member

mysticmind commented Aug 18, 2024

@staffanhedstrom Thanks for the PR. This would work but the solution to include PostGIS support is a bit involved and will require it to be done like an add-on plugin like what we do for NodaTime. I will liaise with @jeremydmiller on this and keep you posted.

Apart from Geometry, there is also Geography as well for PostGIS.

@staffanhedstrom
Copy link
Contributor Author

Right, I had hoped that this was all that was necessary.

I am building an Event Sourcing project using Marten and using Weasel to build up projection tables. We are working with coordinates within a country so just being able to generate the geometry column is all I need and works very well for me.

Comment on lines +107 to 109
{NpgsqlDbType.Geometry, new NpgsqlTypeMapping(NpgsqlDbType.Geometry, DbType.Object, "geometry", typeof(Geometry))},

// LTree types
Copy link
Contributor Author

@staffanhedstrom staffanhedstrom Aug 28, 2024

Choose a reason for hiding this comment

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

To support geography, I think this would do the trick.
{NpgsqlDbType.Geography, new NpgsqlTypeMapping(NpgsqlDbType.Geography, DbType.Object, "geography")},

Geometry and Geography uses the same type in the NetTopologySuite. Would not icluding typeof(Geometry) cause issues here?

@jeremydmiller
Copy link
Member

I'm good with this as soon as the PR is green. I'm doing a weasel release for a bug fix and saw it.

@jeremydmiller jeremydmiller merged commit fcc0c6e into JasperFx:master Sep 14, 2024
6 checks passed
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