jfgodoy / knex-postgis

postgis extension for knex
MIT License
183 stars 25 forks source link

ST_transform add '' aroud SRID #32

Closed GitMorin closed 5 years ago

GitMorin commented 5 years ago

Hi,

I just noticed that I got the same error for a closed issue regarding quotation around SRID.

poi.geom = st.transform(st.geomFromText(poi.geom, 4326),25832); return insert into assets ("asset_type", "geom") values ('test', ST_transform(ST_geomFromText('POINT(11.356373786926271 64.45708785376902)', 4326), 25832)) The returned SQL is fine and run correctly if I copy/paste it to run in pgadmin. But I am getting an error New poi error { error: transform_geom: couldn't parse proj4 output string: '25832': projection not named If I add the quotation marks to the returned sql then I get the same error in postgis, so it looks like it is being parsed to a string at some point?

The version of knex I am using is 0.14.6

jfgodoy commented 5 years ago

Hi @GitMorin, your issue is related with #29. To solve that issue I made a PR #30 but I didn't receive any feedback so I closed it without merge it. I will reopen the PR so you can test it if it's work

GitMorin commented 5 years ago

Brilliant! Thanks I will try it out. Being relatively new to building apps and git. Would you be able to give me a general approach how I implement the pull request without wasting to much of your time? Heading over to google for now.. and hopefully I find it myself

jfgodoy commented 5 years ago

from my memory would be:

1.- clone the project

git clone https://github.com/jfgodoy/knex-postgis.git

2.- checkout the branch of the pull request

cd knex-postgis
git checkout fix--st-transform

3.- install dependencies and run tests

npm i
npm test

4.- create a symlink in the global folder to allow to test knex-postgis in your project

npm link

5.- go to your project and link de dependency.

cd /path/to/your/proyect
npm link knex-postgis
GitMorin commented 5 years ago

Fantastic! Thanks it worked. Tested the code and could insert to the database as expected.

jfgodoy commented 5 years ago

great!, I will merge the PR and publish a new version

jfgodoy commented 5 years ago

I just published a new version, 0.8.0. See the changelog in the Readme, because I did other changes too. thank you @GitMorin for the feedback