postgres table as source for pdal reader - postgresql

Using the point data abstraction library (PDAL), is it possible to use an existing postgis table as input to a pipeline?
I've got some older lidar data stored as xyz points in postgis - I'd like to move them into pointcloud patches without exporting them and re-importing them to improve query efficiency.
Alternatively, can the same be done within Postgis/pointcloud? Is there a way to 'chip' the input points into patches within the database?

Related

Export postgres table data to shape file to build OSRM cluster

I have imported all shapefiles (all 50 states data of USA) to the Postgres/PostGIS DB using QGIS. I am trying to export that data to a single shapefile. I am getting the error below -
Failed to write a shape object. File size cannot reach 4294967068 + 248.Error writing shape 31754843
How to generate single shapefile of large size as OSRM only takes single .osrm file to deploy in cluster.
I have also tried to merge individual shapefile to single one but it is also not working for me.

Is there a way to link (not import!) a dbf table into a PostgreSQL database?

I need to link an external dbf table into an existing PostgreSQL database. I managed to import that table into PostgreSQL but that creates a copy and therefor redundant data. The dbf table is the attribute table of a shapefile, but I don’t need the spatial aspect of it.
The exercise is part of a project to move data from an MS Access database to PostgreSQL hoping that the data then become accessible from QGIS. Th dbf table is at the moment linked into the MS Access database and used in queries (views) which I want to re-build in PostgreSQL.
I found lots of posts about importing dbf tables into but nothing which would work about linking a dbf table. The closest I got was the Foreign Data Wrapper, but I didn’t manage to use it for my purpose. I’m using PostgreSQL with pgAdmin 4.24.
Many thanks
The exercise is part of a project to move data from an MS Access database to PostgreSQL hoping that the data then become accessible from QGIS.
If you must use PostgreSQL in order to provide access to your spatial data from QGIS, I see no other option than importing the shapefile into PostgreSQL (PostGIS). If for whatever reason you do not need the geometries, you can drop the geometry column after importing the shapefile into the database:
ALTER TABLE table_name DROP COLUMN column_name;
Alternative scenario:
If we're talking about static shapefiles and you don't really need to use PostgreSQL, you can use GeoServer to publish this shapefile via Web Feature Service (WFS) - it is at least what I do in small projects. The easiest option would be to copy the shapefiles into a so called GeoServer Data Directory and publish them afterwards. After that you'd be able to access the data from QGIS using its WFS Client.

I want to keep a spatial database of my small firm so i can visualize it in Google earth

I want to manage our spatial data in a database, and I learned Postgres and postGIS are good. I want to be able manage and also visualize the data in Google earth. I don't know where to start from. Is there any help ?
Yes PostGIS extension is used on Postgres to store and manage spatial data. You can use Postgres to store your spatial data. In order to use, postgres table in google earth you need to convert the table columns into kml/kmz.
For that you could use GDAL OGR command line tool. Which convert table into KML with command somthingh like below
ogr2ogr -f "kml" file_name.kml PG:"host=myhost user=myloginname \
dbname=mydbname password=mypassword" "myschema.table_name" \
-s_srs EPSG:<myEPSGcode> -t_srs EPSG:4326
EPSG is the coordinate reference system and other parameters are postgres credentials.
You need to explore it a little bit.

PostGIS, Postgres,geocoding...

I want to be able to do the following:
Select a Polygon and a point and see if the point lies within the polygon...I thought I could do this with MySQL but after a whole day of research it is simply not possible.
I have seen I need to use postgres and postgis, I have never used postgres before.
I have managed to install postgres and postpgadmin and it looks like I have created a database and got it up and running. Now I apparently need to add postgis to the database in order to use the functions? arent they just part of the postgres library? and why are people saying I need to add tables to the database to use the functions?
How do I add postgis to my database?
Can anyone give me any simple clear examples of a query to see if a point is in a polygon?
For purely geometrical queries you won't need postgis. Postgis is required when you want to mess with geographical data.
For an example of checking if a point is inside a polygon, this query should make it clear to you:
postgres=# select '((0,0), (1,1), (1,0))'::polygon #> '(.5, .5)'::point;
This will print true, meaning that the triangle formed by the points (0,0), (1,1) and (1,0) contains the point (.5, .5).
For more info check: http://www.postgresql.org/docs/9.0/interactive/datatype-geometric.html and http://www.postgresql.org/docs/9.0/interactive/functions-geometry.html
PostGIS is the spatial extension for the PostgreSQL database, and as is the case with many general-purpose databases, spatial functions have to be installed on top of a regular install.
The PostGIS website is informative, with nice documentation so head over there and read everything you need to know about obtaining and installing PostGIS.
Once installed and tested you'll need to spatially enable your database and then you're all set. If you have a dataset, of course.

Manifold/PostGIS data manipulation and export

I'm currently working on a GIS database project using Manifold Ultimate.
I am able to import data from PostGIS via the database console, and edit the data as a table object within Manifold.
How do i 'commit' these changes back to PostGIS?
I am required to submit the exported database. What format is expected for a PostGIS export and how is the exporting done?
#mdsumner is correct. Linking the PostGIS data is the way to go.
If you have exported the complete table and edited records it's not simple to replace the data present in PostGIS by a new export. This will fail until you have deleted all the tables with index, triggers and sequences whose names are derived from the same name of exported drawing (with inconsistend handling of lower case). It's not enought to drop the table.
Note that with Manifolds linked storage model you have no client buffer of edited, added or deleted records that are written back in a process of commitment of a transaction. Every edit of every single column is written to PostGIS at once.
Concerning your 2. question: That depends on the target system. Manifold exports GEOMETRY type geometries. Other PostGIS clients may digest only a single type point, line or polygon. You can edit the type in "geometry_columns.type" as long as you have added only the one type of object to the drawing.
I think that if you imported the data it is no longer linked to the DB and you would need to export it and replace what is in the DB. If you link the data the edits you make are commited "live" as the data is not a copy but remains stored by the DB.
I'm not that familiar with this, but that's what the Database Console topic in help describes.