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 ?

1 Like

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
1 Like

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

1 Like

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.)

7 Likes

Thx @tyoung, it’s working now, I’ve already suspected, that the issue is related to elixir 1.15 changes, but haven’t time, to sorted out.

and …, is it really the first time you post on this forum ? if so, wellcome :slight_smile:

2 Likes

Sweet serendipity, I only just got an openstreetmap data dump up and running on Monday with postgis and a Python tile server. Can’t wait to give this a spin.

1 Like