Tag Info

New answers tagged

1

I was able to create the correct answer, so have posted the correct Query here for future users who want to convert GIS data from two joined PostGres Table's to geoJSON I used information from the following pages to help me solve this: http://hashrocket.com/blog/posts/faster-json-generation-with-postgresql ...


0

UPDATE table_without_geoms_name SET the_geom = (SELECT a.the_geom FROM table_with_geoms as a WHERE table_without_geoms_name.parcel_id = a.parcel_id) Of course, you'd need to change the name of your tables accordingly. :-)


2

You're getting an error because: activations.activationid is in a subquery that's been aliased to zz. Since the subquery doesn't really do anything you can flatten it and get INNER JOIN hat.activations.activationid zz ON (zz.activationid = ... However projectsgeom is on a diffrent nesting level too so the above will only change the syntax error. Either ...


0

As Erica pointed out, you have one too many inputs in the syntax. However, the error message function round(double precision, integer) does not exist indicates that you actually used the correct syntax but have the wrong data type in the column to be rounded. The ROUND function requires the numeric data type, whereas the default number type on CartoDB is dp. ...


0

Thanks for your answer! The code is working but the access to the secound layer is missing (landkreise_projected_deleted). How can I access to the secound layer?


0

Another alternative is to use GDAL ogr2ogr utility. If all your csv are in one directory this terminal statement (using OSGeo4W Shell) should work: ogr2ogr -f "PostgreSQL" PG:"host=myserver.abc.com port=54321 user=postgres dbname=mydbname password=mypassword" C://Temp


0

In Linux/Mac or on Windows using cygwin you can simply call the psql command in a loop, using Postgres's built in COPY command. You use the -c switch to psql to indicate that you are running the command inside the quotes. This works well because you can use the operating system to get the list of files very easily. For example, for x in $(ls ...


1

If you want to insert into three tables, added, deleted, unchanged, then there is no need to return anything from the trigger, just do this work inside the trigger. CREATE or REPLACE FUNCTION cd_3() RETURNS trigger as $$ BEGIN INSERT INTO added (geom) SELECT ST_Difference(new.geom, geom) FROM public.landkreise_projected_added ...


1

CREATE table t_intersect AS SELECT hp.gid, hp.st_address, hp.city, hp.st_num, hp.the_geom FROM public.housepoints as hp WHERE NOT EXISTS( SELECT * From public.parcel as par WHERE ST_Intersects(hp.the_geom,par.the_geom))


2

To select top populated cites in given extent you can use ogr2ogr's option -spat: spatial query extents. Only features whose geometry intersects the extents will be selected. Try: ogr2ogr -sql "SELECT * FROM ne_10m_populated_places ORDER BY POP_MAX DESC LIMIT '15'" -dialect SQLITE -spat 1 49 7 52 ./places.shp ...


0

This is the method that I eventually used to solve the problem. This works for basic LINESTRINGS AND POLYGONS. MULTILINESTRINGS and MULTIPOLYGONS would require a more complex function. /* Create a temporary table that contains the ID of each line and two geometry columns. The first contains any line portions that are outside of all of the polygons. The ...


0

OK, let me finish this up. When the message shows up, you just ignore the message and there must be a "Events layer" you can find under Table of Contents. You export that layer to shapefile and you're done. I've been tangled up for quite a while until I found out that the point data is actually extracted from your CSV or text files and it's just a problem ...


1

You didn't post the whole function, so there could be several reasons, why it doesn't work. For example the declaration of output values could be wrong. You need to have something like this, if you want to return id and geom: CREATE OR REPLACE FUNCTION pgr_nearest_node1( IN tbl varchar, IN x1 double precision, ...


1

If you look at the source declaration of pgr_drivingDistance you will see that it is linking to a C function, driving_distance. So unless you want to change the underlying C function, and recompile, you are stuck, as this is not one of those plpgsql functions that you can change directly, unlike say ...



Top 50 recent answers are included