NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I have a table name erpAssets which has column name Region of type polygon. it contains entries of points also like (-79.4609576808001,43.9726680183837)).

I have written query which convert these points to geometry which is used by mapnick to generate tiles.

( SELECT replace(concat(concat('POINT',concat(trim(TRAILING ')'FROM concat('(',trim(LEADING '(' FROM region::TEXT)::TEXT) ),')')),''),',',' ') as data from "erpAssets" where parent=326815) as foo
) as points

My osm.xml file is as follows:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map [
<!ENTITY % entities SYSTEM "inc/entities.xml.inc">
%entities;
]>
<Map background-color="#bb0000" srs="&srs900913;" minimum-version="2.0.0">
  &fontset-settings;
 <Style name="theme_park">
     <Rule>
      <PointSymbolizer file="&symbols;/alpinehut.p.16.png"

      />

    </Rule>

</Style>

&layer-shapefiles;
<Layer name="theme_park" status="on" srs="&osm2pgsql_projection;">
    <StyleName>theme_park</StyleName>
    <Datasource>
      <Parameter name="table">
        (SELECT ST_GeomFromText(data)
FROM
(
SELECT replace(concat(concat('POINT',concat(trim(TRAILING ')'FROM  concat('(',trim(LEADING '(' FROM region::TEXT)::TEXT) ),')')),''),',',' ') as data
 from "erpAssets" where parent=326815) as foo       
        ) as points

      </Parameter>
      &datasource-settings;
    </Datasource>
</Layer>
</Map>

Tiles are not generated and i am getting error on console as follows: Postgis Plugin: geometry name lookup failed for table '"erpassets"'. Please manually provide the 'geometry_field' parameter or add an entry in the geometry_columns for '"erpassets"'.

I have converted region column into geometry by aliasing then why i am not getting points on map?

asked 15 May '14, 07:18

Muneem's gravatar image

Muneem
11112
accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×710
×341
×134

question asked: 15 May '14, 07:18

question was seen: 9,837 times

last updated: 15 May '14, 07:18

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum