Tag Info

New answers tagged

0

I would start with TileMill, some excellent open source software. This will allow you to design maps, pulling data from shape files, postgis, etc, and render then via Mapnik to various different formats. Good luck.


0

Depending on how confident you are with technical setups, rather than running local GeoServers, you could use something like TileMill to generate MBTiles files of all your images, or just the images using Invar. This can then be show by simple python code like TileStache. This would be a much lighter weight setup.


0

I agree with the other comments, for it to be this slow you need to not have setup indexing correctly. How are you storing the data ? Are you using JSON ? You need to have spatial columns or indexes to get fast queries working. Check out the links below for examples of spatially indexing JSON twitter data. ...


0

use "explain" (http://www.postgresql.org/docs/9.3/static/sql-explain.html) to see if your spatial index is being used, and make sure you've run "analyze" (http://www.postgresql.org/docs/9.3/static/sql-analyze.html) to make sure that the db has collected sufficient statistics on your indices. It sounds to me like you don't know what you're doing with respect ...


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;


0

Given the nature of the lines you're trying to create versus the geometry you have, I think it will probably be fastest/simpler to just create new features as in the tutorial you have linked to. Any method that actually converts the polygons to lines will involve splitting the lines at certain points and/or deleting a lot of extra nodes/lines/etc. There is ...


0

Use the polygon to lines tool and then remove those parts of the line layer which you don't want to keep.


0

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 ...


9

It is not a string format. It is a binary format using integers, double precission and special bytes used for flags. What you see as output above is not the internal format but the wkb format represented as hex numbers The internal format is described here: http://trac.osgeo.org/postgis/browser/trunk/liblwgeom/g_serialized.txt The document is written ...


3

First use st_closestpoint. Then from the result make a vertical line that passes the multilinestring. Finally use st_3dclosestpoint between the vertical line and the multiline. Theoretically you could use st_3dintersects instead but that will cause you problems from precision issues.


1

You specify that the route should start on node 1 but there is no node 1 in the query result set. That can't work ... According to the documentation http://docs.pgrouting.org/dev/src/tsp/doc/index.html, you should specify the start point id. This works: create table tsp_test (id integer, x double precision, y double precision); insert into tsp_test ...


1

For the satellite tiles, you could render them yourself using Mapnik. Landsat and NAIP are two sources of free satellite raster data. edit: I've also just come across a growing dataset (also free) of High Resolution Orthoimagery, which I've never used, but is much higher detail than the other two sources.


1

They are called diff updates. You have two options .. Apply the Diffs from PlanetOSM and then remove the imported geometry that are outside of your bounding box Use the Geofabrik Extracts for North America and apply the Geofabrik diffs which are updated daily. I do both, 3 minute diff updates for the planet and daily diff updates for the Philippines, in ...


2

Your approach looks ok to me. On my local system, I skipped the TileCache part. Mapnik fills the folders in the way Openlayers reads them from disk using file:///... I don't know if leaflet can do it the same way. For the satellite tiles: You have no chance to get them legally. Google and bing do not like storing their tiles locally. If you have ...


1

In general: ALTER TABLE your_table ADD COLUMN area double precision; UPDATE your_table SET area=ST_AREA(geom::geography); (If your srid is 4326 and your data is stored as geometry) Edit: To round to 2 decimals use round() funcrion. If I remember right it works on numeric type and not double precision. So you need something like: ...


0

The term for what you want to do is incremental updating so I recommend that you look at the Osm2pgsql page where it says: osm2pgsql has two main modes of running - normal and slim mode. It is highly recommended to run osm2pgsql in slim mode. Some important features (including incremental updates (planet diffs, the initial load to populate the ...


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


0

I seemed to have solved the problem by taking this approach: 1) perform create table highwaysinglegeom as select st_union(the_geom) from analysis.po_highway 2) perform the update query above using the single geometry highway table as the intersection layer rather than separate multilinestrings from my network.


1

Have you tried ST_Line_Interpolate_Point? Normally it should returns a point interpolated along a line according to the fraction of total length of linestring. The example below shows how it works. You probably need to compute the linestring length before to get the fraction of total length. --Return point 20% along 2d line SELECT ...


-1

DXF export only the rows and then copy and paste the features as a new vector layer


1

You could use the Distance to nearest hub algorithm from the Processing plugin which you could add your points and your lines layer instead of going through a query. From a couple of example layers that I have, you can get something like this: Then when you open up the Attributes Table for the output layer, you will be given the HubName and HubDist in ...


0

Looks like you need something like Osmosis or imposm. These are tools that will convert raw OSM data output by JOSM into a custom postgis format. Because OSM is free-tagging, there is no "official" way to convert the XML into a usable data structure that a GIS can read. The main importers currently focus on roads, buildings, points of interest etc. because ...


0

I defined the srid wrong. Transposed the 8 in 3857 for the 5. I used the statement below to fix!!!! Forest for the trees! SELECT UpdateGeometrySRID('roads','geom',3857);


0

Because i still can't comment here, i add this answer SCW give the best answer, select ST_AsText(ST_OffsetCurve( ST_GeomFromText('LINESTRING(10 10,10 20, 20 20 )'), 1, 'right', 'join=mitre mitre_limit=5.0')); -------------- LINESTRING(20 19,11 19,11 10) But looks like the function change http://postgis.refractions.net/docs/ST_OffsetCurve.html Now the ...


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 ...


0

It's a bit high time I answered, but here goes: Since the use of Wax is deprecated as you mentioned, here are some Mapbox examples to get you started. Bear in mind that the Leaflet API is embedded into Mapbox.js and can be used hand in hand with Mapbox code. Using http://localhost:8000/{z}/{x}/{y}.png means to store the tiles in your own folder. This is ...


1

Probably after your requirements get complicated, it is best to think of making a scalable application. The advantage of working with a geometric column is the index, plus you can also work with wkt, GeoJSON and other standards that openlayers postgis and handle very well, so you would simplify the development Here you can find a good tutorial


1

If you have the appropriate licence (ArcGIS Advanced), using the Generate Near Table would work fine for what you are looking for. It is fairly simple to use following the instructions on the ArcGIS Resource page. However, it appears as though you may not be too familiar with GIS software, so you may wish to simplify your output by adding the city layer ...


1

Regina's comment actually answered the question--it isn't expected behaviour. As a workaround, I wrapped the call with function w/ exception block so that I get null back (which is OK for my purposes). Feel free to edit/improve because pl/pgsql isn't my strength: --DROP FUNCTION public.st_nullableconcavehull(geometry, double precision, boolean); ...


1

This probably won't work in practice, but it does in theory: ST_DumpRings to get all the linework from your polygons ST_Union the rings to get a single set of boundaries ST_Polygonize the linework to get a complete set of areas bounded by the linework ST_PointOnSurface the areas to get points ST_Intersects the points with the original polygons and Count(*) ...


2

It's not a bug, more like a strategic laziness. 1.X versions of PostGIS only supported GEOMETRYCOLLECTION EMPTY, not other forms of empty. For 2.X I (perhaps foolishly) embraced the full variety of nothings. The result is a not-entirely-complete support of varieties of nothing, made slightly ill-formed by the fact that support libraries like GEOS have their ...


0

You've got few ways to do this: Draw the point in upper left corner of geometry and order by distance from this point Order by added coordinates of upper left vertex of both geometries Select * from ( SELECT ((ST_Dump(ST_Split(circle, line))).geom) As wkt FROM ( SELECT ST_GeomFromText('LINESTRING(73.3864598921383 ...


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 ...


0

There is likely a problem with your SQL in the subquery... If you are putting this query as the subquery EXACTLY... SELECT * FROM shortest_path_astar(' SELECT gid as id, source::integer, target::integer, length(the_geom)::double precision as cost, x1, y1, x2, y2 ...


0

Based on that answer I'm trying to create new poygon layer that is extent of base layer (also polygon). But statement doesn't work: CREATE OR REPLACE VIEW xxx.extent AS SELECT ST_SetSRID(ST_Extent(geom), 2180) as geom from xxx.buildings_2013; But resulting table isn't spatial. Geometry column in table buildings_2013 is named geom.


0

I Finally found the relevant post from Paul Norman and Andre Joost on a similar Question .. What is occuring appears to be a somewhat subtle bug with osm2pgsql where osm2pgsql requires id-sorted nodes, but the API does not guarantee that. The easiest solution is to import with --slim --drop. The --slim flag causes osm2pgsql to use the database instead of ...


0

If you are typing a geometry's WKT into pgAdmin III, you need to specify the SRID using EWKT syntax, otherwise it defaults to 0. Type this into the geometry field of pgAdmin III: SRID=26191;POINT(25800 256000) Otherwise, @MakinFlippyFloppy has the correct SQL way, using ST_SetSRID.


3

What's happening is that the data you are trying to insert does not have an SRID assigned. To assign one, try wrapping the inserted geometry in your insert statement with ST_SetSRID(). E.g., INSERT INTO public.borne (num_borne, shape_borne) (SELECT num_borne, ST_SetSRID(shape_borne, 26191) FROM public.sometable); or INSERT INTO public.borne ...


0

I thin below link can help you, Check out below page :: http://postgis.org/docs/UpdateGeometrySRID.html


2

@MKennedy is right, the data are EPSG:21897, so you just need to declare that at load time, and then everything will magically work. shp2pgsql -s 21897 -W LATIN1 -D -I roads.shp roads | psql -d mycity And then see if you can get good geography coordinates out. SELECT ST_AsText(ST_Transform(geom,4326)) FROM roads LIMIT 1; Better! ? If you want to ...


1

If you plot your coordinates assuming that latitude and longitude form a cartesian coordinate system (everything meets at right angles and the x and y axis are straight lines) then you would expect ST_Azimuth to give your anticipated ~45 degrees. However, lines of latitude and longitude aren't straight and they don't form a cartesian coordinate system. So, ...


1

The following steps works in nearly every case for this procedure. It may be a good idea to repair geometry if you find this process is not producing your desired results. There is the condition of truncated field names should they be greater than a certain length. Generally this is not as severe a problem as the actual transfer, though. Open ArcGIS. ...


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.


0

I use both GraphHopper AND Pg_Routing Pg_Routingis a lot more flexible but is relatively slower (Depending on the size of the area). You can change costs on an edge in real time GraphHopper buids graphs from an OSM Extract and has its own built in web Server, so is very quick to get up and running ..


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/


0

I seems very similar to post "postgis, extrapolate a line". If I avoid repetition of cited post, I think you just need to extrapolate beyond your extreme points. In a query you get something like this should work: SELECT ST_MakeLine(ST_TRANSLATE(a, sin(az1) * len, cos(az1) * len),ST_TRANSLATE(b,sin(az2) * len, cos(az2) * len)) FROM ( SELECT a, b, ...


0

Well, others have tried well to answer my question. But those are not according to my requirements. What I did in this case is to handle the case at Server-end. Using PHP array, get the dumped geometries: while ($row = pg_fetch_assoc($rs)) { $result[] = $row['wkt']; } By using above snippet each dumped geometry is stored at an ...


0

Try to use function st_setsrid() to set srid of your data (if it's geographical coordinates use 4326) or function st_transform() to transform data from one srid to another. Last (but not least) if your data is in geographical coordinates you can use datatype geography instead of geometry.


0

At least it is in the pbf file: I filtered the file with osmosis for ref="B 10", and loaded the result into QGIS. Osm2pgsql needs a bit longer, but has the line in the same way. Same osm2pgsql version, but with an extended default style, and 32bit PostgreSQL 9.3 using Windows 7. EDIT Mapnik for Windows is currently only available for 32bit, so you ...



Top 50 recent answers are included