odix67
Unknown type Geo.PostGIS.Geometry for field
I’m playing around with the geo_postgis module, I’ve already successfully worked with it ~2y ago and for new prototype using the elixir 1.15.5, OTP 26.0.2, phoenix 1.7.7, … I’ve got the following error:
== Compilation error in file lib/hello_gis/geom/geom_check.ex ==
** (ArgumentError) unknown type Geo.PostGIS.Geometry for field :geom
(ecto 3.10.3) lib/ecto/schema.ex:2318: Ecto.Schema.check_field_type!/4
(ecto 3.10.3) lib/ecto/schema.ex:1931: Ecto.Schema.__field__/4
lib/hello_gis/geom/geom_check.ex:7: (module)
I’ve followed the instructions on from GitHub - felt/geo_postgis: Postrex Extension for PostGIS, but ecto is still complaining.
I’ve also post a sample (problem) project on GitHub - odix67/hello_gis: Just a standard, generated phoenix application, trying to use :geo_postgis, latest release, with elixir 1.15.5 OTP 26.0.2
Any suggestions ?
Marked As Solved
tyoung
Hi @al2o3cr! I’ve just published v3.4.4, which should fix the compatibility issue with Elixir 1.15. The changelog has the backstory of what went wrong, but the long and short of it is that after updating to v3.4.4, you’ll need to run:
mix deps.clean geo_postgis ecto && mix deps.get
(And if you switch back and forth between branches on 3.4.4 versus an older version, you’ll need to run that each time you switch.)
Also Liked
odix67
thx for the fast response, but I’ve put this into the common config.exs, also tried it into in dev.exs, but doesn’t help
odix67
al2o3cr
Haven’t tried this, but there appears to be a line missing from your config; the example under “use with Ecto” on the Felt repo has an extra types line:
#Add extensions to your repo config
config :thanks, Repo,
database: "geo_postgrex_test",
username: "postgres",
password: "postgres",
hostname: "localhost",
adapter: Ecto.Adapters.Postgres,
types: MyApp.PostgresTypes # <=========== this one
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








