[postgis-users] Merging Contour tables in PostGIS

Eduin Yezid Carrillo Vega yecarrillo at gmail.com
Thu Feb 19 03:59:47 PST 2009


As general rule, don't use UPPERcase field names (oracle way). If you
really need to use them, use double quotes:

SELECT a."ELEVATION",ST_LineMerge(ST_Collect(a.the_geom, b.the_geom))
AS the_geom INTO merged_contours FROM contours1 AS a,contours2 AS b
GROUP BY "ELEVATION";


Eduin Yesid Carrillo Vega
Ingeniero Civil, Esp. Sistemas de Información Geográfica
Centro de Investigación y Desarrollo en Información Geográfica
Instituto Geográfico Agustín Codazzi - IGAC
Cr 30 48-51
Tel +57 1 3694000  ext 4603
Bogotá D.C., Colombia



On Thu, Feb 19, 2009 at 3:10 AM, Paragon Corporation <lr at pcorp.us> wrote:
> Max,
> It looks like when you created your table you created ELEVATION as
> "ELEVATION".   Better to not use quotes when defining fields since
> PostgreSQL will take the column name literally rather than forcing to
> lowercase.
>
> Which means you have to refer to it as
>
> a."ELEVATION"
>
> If you don't quote your columns during creation you can then refer to them
> as
>
> A.ELEVATION, a.elevation, a.Elevation etc. (in those cases it assumes the
> field is lowercase and stores it as lowercase)
>
> Leo
>
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Max Bott
> Sent: Thursday, February 19, 2009 2:34 AM
> To: postgis-users at postgis.refractions.net
> Subject: [postgis-users] Merging Contour tables in PostGIS
>
>
> Hi All,
>
> I have 2 tables (contours1 & contours2) in my postgis database which I have
> populated from shapefiles containing contours in adjacent geographic areas.
> These 2 tables contain (amongst other things) the following columns
>
> "ELEVATION" double precision,
> the_geom geometry
>
> To create my merged table covering the contours from both contours1 and
> contours2 I used
>
> SELECT a.ELEVATION,ST_LineMerge(ST_Collect(a.the_geom, b.the_geom)) AS
> the_geom INTO merged_contours FROM
> contours1 AS a,contours2 AS b
> GROUP BY ELEVATION;
>
> but that gave the result
>
> ********** Error **********
>
> ERROR: column a.elevation does not exist SQL state: 42703
> Character: 8
>
> Any ideas?
>
> Cheers,
> Max
>
> --
> View this message in context:
> http://www.nabble.com/Merging-Contour-tables-in-PostGIS-tp22095290p22095290.
> html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list