Tag Info

Hot answers tagged

3

you have to use the union function like this SELECT att1, st_centroid(st_union(geom)) as geom FROM schema.table GROUP BY att1; so you can obtain centroid of point that have same attribute.


3

You can use ogr2ogr with the -sql option to use a sql statement


2

No and yes. You can configure pgadmin to call external programs, like shp2pgsql-gui, out of a menu option, which can make things easier for new users (see OpenGeo Suite, for example). But a full commandline like shp2pgsql has too many parameters needed to be effectively called by pgadmin.


2

SELECT cdb_usertables, pg_size_pretty(pg_total_relation_size(cdb_usertables)) FROM CDB_UserTables() ORDER BY pg_total_relation_size(cdb_usertables) DESC The CDB_UserTables() function is mentioned in another question regarding getting a list of all tables. It returns one column named after the function. pg_total_relation_size() "accepts the OID ...


2

I imported a Planet File on a 24Gb Machine (Ubuntu Trusty) with the following .. bzcat planet-latest.osm.bz2 | osm2pgsql --verbose -U YourUser --flat-nodes flat-nodes --keep-coastlines --cache 24000 --hstore --hstore-add-index --tablespace-index pg_default --exclude-invalid-polygon --number-processes 6 --unlogged --cache-strategy dense --extra-attributes ...


2

Your computer should be fine for importing Europe. Given your dataset size and computer, I'd recommend something like this osm2pgsql -c -S /usr/share/osm2pgsql/default.style --slim -d osm-europe --flat-nodes flat-nodes.bin --number-processes 8 -C 20000 europe-latest.osm.pbf I'm assuming that you have an 8 thread CPU, if not, adjust --number-processes. ...


2

I usually do this using QGIS. I load the kml layer, save as shapefile and add the columns that are necessary for rendering. Then I open a connection to my postgis database, delete everything inside the current view, and copy-and-paste the kml data into the postgis layer. I have created a separate bboxdb inside postgis for such cases, so my original osm ...


2

Well, before you convert the database, you could run the Domain to Table geoprocessing tool http://resources.arcgis.com/en/help/main/10.1/index.html#/Domain_To_Table/001700000022000000/ which should convert a domain to a stand-alone table that you could put in the database. Then, you should be able to just convert the database, including stand-alone tables ...


2

JJD yes there is. I haven't used it myself. You use the -m option and pass a mapping file that has the old column name and new column name on each line. As Ryan alluded to here: http://www.bostongis.com/pgsql2shp_shp2pgsql_quickguide.bqg I suspect he was thinking of -m and mistyped -f. Hope that helps, Regina


2

You've switched the order of your lat,lon. See the documentation for ST_MakePoint() and you'll see that it requires: ST_SetSRID(ST_MakePoint(lon, lat),4326) Then, after to make your changes, try verifying: SELECT ST_AsText(location) FROM *tablename* LIMIT 10;


2

I just had the same problem on Ubuntu Server 14.04. I installed postgis extension from the official ubuntu repositories. So I used # apt-get install postgis. Then, find /usr -name postgis.control didn't return any result. The reason was extension/postgis.control wasn't installed because of postgis-scripts wasn't. $ aptitude search postgis i ...


1

Benno, you can use Spatial Manager Desktop, the Professional edition can read and write the formats you said(among others), and also supports the execution of tasks from the command line. You can download a trial version (limited), here: http://www.spatialmanager.com/downloads/ Hope this helps Disclaimer: I work for Opencartis (Spatial Manager ...


1

myVectorLayer = QgsVectorLayer("polygon", "mypoly", 'ogr') does not create a valid vector layer, therefore mySymbol1 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType()) does not return a valid symbol and causes the error you see. Replace "polygon" with a valid file path.


1

AFAIK there is currently no 'best practise' on how you organize the OSM data at your PostGIS backend. There are different database schemas that are tuned for specific purposes: rendering geospatial lookups / reverse geocoding fulltext search / gazetter ... If you have a very specific usecase, you might tweak the OSM importer mappings (e.g. at osmosis or ...


1

You can't. Table inheritance is a bit limited. In particular, you can't have a foreign key that references all parts of an inherited table set, and you can't define triggers or constraints that're inherited by a set of tables.


1

What do you mean by no spatial view. You mean you are not seeing it in geometry_columns table or your viewer is not loading it? If you are using PostGIS 1.5 or lower, you have to manually add the view to the table geometry_columns table. In PostGIS 2.0+, it will show in list but won't show type. To get type you need to do cast it. Also many views like ...


1

As this message show: UnicodeDecodeError: 'utf8' codec can't decode byte 0xc4 in position 0: invalid continuation byte It is likely due a problem with character encodings. Maybe your database is using ASCII instead of UTF8. To check what character encoding is using your database, you cold ask your postgreSQL server with PGAdmin III or psql. If you have ...


1

If you're a very beginner you should try this tutorial of osm2po by @Underdark Osm2po will give you ready to use graph from osm data as sql script file, all you have to do is load it into database via psql -f command. In this table every single record is edge. Every edge has 2 vertices source and target - coordinations of this points are in column x1,y2 ...


1

You should check the pgRouting project. There is a great step to step workshop/tutorial. http://workshop.pgrouting.org/



Only top voted, non community-wiki answers of a minimum length are eligible