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
binarytemple

binarytemple

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.

Where Next?

Popular in Questions Top

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
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
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

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
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
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
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement