pdpotter opened a new issue #48:
URL: https://github.com/apache/incubator-age/issues/48


   Is there a way to add PostGis data as property to a node (e.g., a [point 
geometry](https://postgis.net/docs/ST_MakePoint.html))?
   
   I've tried:
   ```
   SELECT * FROM cypher('testgraph', $$
       CREATE (n:Test {id: 1, location: ST_SetSRID(ST_MakePoint(-71.10, 
42.32),4326)}) return n
   $$) as (a agtype);
   ERROR:  function ag_catalog.age_st_makepoint(agtype, agtype) does not exist
   LINE 2: ... (n:Test {id: 1, location: ST_SetSRID(ST_MakePoint(-71.10, 4...
                                                                ^
   HINT:  No function matches the given name and argument types. You might need 
to add explicit type casts.
   
   SELECT * FROM cypher('testgraph', $$
       CREATE (n:Test {id: 1, location: 
public.ST_SetSRID(public.ST_MakePoint(-71.10, 42.32),4326)}) return n
   $$) as (a agtype);
   ERROR:  function public.ST_MakePoint(agtype, agtype) does not exist
   LINE 2: ...1, location: public.ST_SetSRID(public.ST_MakePoint(-71.10, 4...
                                                                ^
   HINT:  No function matches the given name and argument types. You might need 
to add explicit type casts.
   
   SELECT * FROM cypher('testgraph', $$
       CREATE (n:Test {id: 1, location: 
public.ST_SetSRID(public.ST_MakePoint(-71.10::float, 42.32::float),4326)}) 
return n
   $$) as (a agtype);
   ERROR:  ag function does not exist
   LINE 1: SELECT * FROM cypher('testgraph', $$
                                              ^
   DETAIL:  agtype_typecast_float(1)
   
   SELECT * FROM cypher('testgraph', $$
       CREATE (n:Test {id: 1, location: public.ST_GeomFromText('POINT(-71.10, 
42.32)', 4326)}) return n
   $$) as (a agtype);
   ERROR:  function public.ST_GeomFromText(agtype, agtype) does not exist
   LINE 2: ...E (n:Test {id: 1, location: public.ST_GeomFromText('POINT(-7...
                                                                ^
   HINT:  No function matches the given name and argument types. You might need 
to add explicit type casts.
   
   SELECT * FROM cypher('testgraph', $$
       CREATE (n:Test {id: 1, location: public.ST_GeomFromText('POINT(-71.10, 
42.32)'::text, 4326)}) return n
   $$) as (a agtype);
   ERROR:  typecast 'text' not supported
   LINE 1: SELECT * FROM cypher('testgraph', $$
                                              ^
   ```
   
   Additional information: the indivial extensions (age, postgis) do work:
   ```
   SELECT * FROM cypher('testgraph', $$
       CREATE (n:Test {id: 1}) return n
   $$) as (a agtype);
                                        a                                      
   ----------------------------------------------------------------------------
    {"id": 1688849860263978, "label": "Test", "properties": {"id": 1}}::vertex
   (1 row)
   
   SELECT ST_SetSRID(ST_MakePoint(-71.10, 42.31),4326) as location;
                         location                      
   ----------------------------------------------------
    0101000020E61000006666666666C651C048E17A14AE274540
   (1 row)
   
   SELECT PostGIS_Version();
               postgis_version            
   ---------------------------------------
    2.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
   (1 row)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to