Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8116135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:43:13+00:00 2026-06-06T03:43:13+00:00

I am attempting to use COPY FROM STDIN to import data into my table.

  • 0

I am attempting to use COPY FROM STDIN to import data into my table. One of the columns in my table is of type geometry. My command looks something like this…

COPY "WeatherStations" ("Station_ID", "Station_Code", "Station_Name", "Station_Location") FROM stdin;
1       KAVP    WILKES-BARRE    ST_GeomFromText('POINT(41.338055 -75.724166)')
2       KOKV    WINCHESTER      ST_GeomFromText('POINT(39.143333 -78.144444)')
3       KSHD    SHENANDOAH      ST_GeomFromText('POINT(38.263611 -78.896388)')
...

However, I think it is attempting to insert the text “ST_GeomFromText(‘POINT…” and failing instead of evaluating the expression and inserting the result of the expression. Does anyone know what might be going on here and how I can get the actual geoms inserted?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:43:15+00:00Added an answer on June 6, 2026 at 3:43 am

    I had a bad time figuring out how to bulk copy/load geometry data into PostGIS using the COPY FROM STDIN command, I couldn’t find official documentation on this topic.

    Altering the column during the bulk load (the ALTER TABLE / SET DATA TYPE / USING) was not an option to me because it is only supported in PostGIS 2.0+ for the Geometry type, nor was acceptable the use of a temporary table.

    There is indeed a direct way to do it (at least in PostGIS 1.5.2+).
    You can simply rewrite the data for your copy statement this way, using a simple WKT (Well-known text) representation for your Geometry data:

    1       KAVP    WILKES-BARRE    POINT(41.338055 -75.724166)
    2       KOKV    WINCHESTER      POINT(39.143333 -78.144444)
    3       KSHD    SHENANDOAH      POINT(38.263611 -78.896388)
    

    If you have enforced a SRID constraint on the geometry column you’ll have to use the following syntax (in this example the SRID is 4326) known as EWKT (Extended Well-Known Text, which is a PostGIS specific format):

    1       KAVP    WILKES-BARRE    SRID=4326;POINT(41.338055 -75.724166)
    2       KOKV    WINCHESTER      SRID=4326;POINT(39.143333 -78.144444)
    3       KSHD    SHENANDOAH      SRID=4326;POINT(38.263611 -78.896388)
    

    Closing note: there must be no space between “POINT” and the opening parenthesis “(“, or the COPY will still return error saying your geometry data has an invalid format.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting to use the data series from this example no longer passes the JSONLint
I'm attempting to copy cells, one at a time, from an Excel 2003 (or
I'm attempting to use the adb pull command to copy only certain files (jpg)
Attempting to use XStream's JavaBeanConverter and running into an issue. Most likely I'm missng
When attempting to use HttpWebRequest to retrieve a page from my dev server, I
In attempting to use std::select1st from <functional> in a VS2008 project I found that
I am trying to copy some property values from one object to another (both
I'm trying to use jQueryUI draggable/droppable/sortable to move (not copy) items from a source
I'm attempiting to use cx_OracleTool's CopyData.py script to copy data between two tables on
Running into the following problem specifically in Safari 5.1.2 when attempting to use the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.