odix67

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

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

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

odix67

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:

al2o3cr

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

Where Next?

Popular in Questions Top

greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
mgjohns61585
Could someone help me? I’m making my first elixir program, number guessing game. I can’t figure out how to convert the user’s guess from ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a &gt; b) do {:ok, "a"} end if (a &lt; b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
dotdotdotPaul
Okay, I’m having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I’m sure I’...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
Lily
In templates/appointment/index.html.eex: &lt;%= for appointment &lt;- @appointments do %&gt; &lt;tr&gt; &lt;td&gt;&lt;%= appoi...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 126479 1222
New

We're in Beta

About us Mission Statement