Importing with configuration: ind_adm2, public, geom, C:\Program Files\OpenGeo\OpenGeo Suite\webapps\geoserver\india map\IND_adm2, mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=0 Shapefile type: Polygon PostGIS type: MULTIPOLYGON[2] Failed SQL begins: "SET CLIENT_ENCODING TO UTF8; SET STANDARD_CONFORMING_STRINGS TO ON; BEGIN; CREATE TABLE "public"."ind_adm2" (gid serial, "id_0" int4, "iso" varchar(3), "name_0" varchar(75), "id_1" int4, "name_1" varchar(75), "id_2" int4, "name_2" varchar(75), "nl_name_2"" Failed in pgui_exec(): ERROR:  function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist LINE 17: SELECT AddGeometryColumn('public','ind_adm2','geom','0','MUL...                 ^ HINT:  No function matches the given name and argument types. You might need to add explicit type casts.  Shapefile import failed.
123781
I've tried this a few different ways and keep getting the same error. I have a shapefile currently in WGS84 UTM Zone 15 which is SRID 32615.  I used the ArcMap multipart to singlepart tool to create a singlepart polygon. I followed the instructions found at  to install postgresql and postgis.  I open pgAdmin III and select the postgis_21_sample table. Plugins > PostGIS Shapefile and DBF Loader 21.  I check connection details and it connects fine.  I add my .shp file. I set Schema to public and Table to postgis_21_sample. I leave geo column alone and set SRID to 3265.  When I click import I get  ============================== Importing with configuration: postgis_21_sample, public, geom, C:\GIS\forest_buffer\postgres_single.shp, mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=3265 Shapefile type: Polygon PostGIS type: MULTIPOLYGON[2] Failed SQL begins: "SET CLIENT_ENCODING TO UTF8; SET STANDARD_CONFORMING_STRINGS TO ON; BEGIN; CREATE TABLE "public"."postgis_21_sample" (gid serial, "shape_leng" numeric, "shape_area" numeric, "orig_fid" int4); ALTER TABLE "public"."postgis_21_sample" ADD PRIMARY KEY (gid);" Failed in pgui_exec(): ERROR:  function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist LINE 9: SELECT AddGeometryColumn('public','postgis_21_sample','geom'...                ^ HINT:  No function matches the given name and argument types. You might need to add explicit type casts.  Shapefile import failed.   I've also tried projecting this shapefile to WGS84 with SRID 4326 and receive the same error.  There are >100,000 features and I need to buffer, dissolve, negative buffer, and finally buffer back to the original size to fill gaps.  ArcMap and QGIS fail to do it after days of waiting.
41351
I run PostgreSQL 9.1 and PostGIS 2.0. I have a table that contains one geometry column.   But that column contains point, polygons lines, etc.   So I set it like so,   ALTER TABLE jake ADD COLUMN jake_geom geometry;  and then I setted some constraints to make it geometry enabled, but not limited on a single geometry type  ALTER TABLE jake   ADD CONSTRAINT enforce_dims_geom CHECK (st_ndims(jake_geom) = 2);  ALTER TABLE jake   ADD CONSTRAINT enforce_srid_geom CHECK (st_srid(jake_geom) = 900913);   Now, I want to reproject the geometries in that column to 4326.   According to , for the transform to work, I need to set a geometry type.  (the TYPE geometry(MultiPolygon,2163) part)  but my column does not have certain geometry type. How do I proceed?  Or I can simply do  ALTER COLUMN geom USING ST_Transform(geom,2163);  avoiding to set a type?
58478
I have created a linked server (PostgreSQL). When I try to import data from SQL Server to linked server I get the following error:     String or binary data would be truncated   Even though I am familiar with this error, I have never faced it for the text data type. There is only text datatype in my table.  I would like to know is there are any limitation in linked server?  I have created a test table with a text column. When I try to insert from my linked server I can't insert more than 4000 characters. For testing purpose only I did this but actually I need to import data from SQL to p-sql.  Created following table in p-sql using pg admin  create table test_sql ( col text )   When I try to then inserted values  insert into linkedserver.database.schema.table (col)  values ('4001 char')   but it fails to insert.  I have successfully created linked server with below query:  EXEC master.dbo.sp_addlinkedserver @server = N'Test_server', @srvproduct=N'PostgreSQL Unicode(x64)', @provider=N'MSDASQL', @provstr=N'Driver=PostgreSQL Unicode(x64);uid=postgres;Server=######;database=test_db;pwd=password;SSLmode=disable;PORT=5432'
71908
I have a specific location: lat, lng and accuracy(meters) I want to return a geography object that will represent a polygon that surrounds this point with a given radius that will be equivalent to accuracy (I don't want to use a circle)  postgis code:  SELECT ST_AsText(CAST(ST_Buffer(ST_SetSRID(ST_Point(-74.005847, 40.716862),4326),10) As geography));   returns an object with points such as: (-64.005847 40.71.6862) That are on a huge radius and not 10 meters as requested.  What am I doing wrong here?
88254
I'm producing some Spatialpolygondataframes with R that I would like to upload to my PostGIS Database. I've found out that the way to do this is via the  function using the .   Sadly, my version of rgdal and GDAL/OGR doesn't support the PostgreSQL function (as seen when listing the available drivers using ogrDrivers()). Is there a way to make this driver available? My sessionInfo() is as follows:  R version 3.2.3 (2015-12-10) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows &gt;= 8 x64 (build 9200)  [...]  other attached packages: rgdal_1.1-10 gdalUtils_2.0.1.7 RPostgreSQL_0.4-1
70192
I have QGIS 1.8.0 installed via OSGeo Installer and work on win 7. All I need is to upload the shapefile to the database via this plugin. Unfortunately I am receiving an error:  Something's wrong: ["'shp2pgsql' is not recognized as an internal or external command,\n", 'operable program or batch file.\n']   How to install and configure shp2pgsql to make this plugin work fine?
22907
I have a CSV file I open as a DataFrame. Among the columns is one named geom 1 :  df.loc[:, 'geom 1'] &gt;&gt;&gt; 0       {'type': 'Polygon', 'coordinates': [[[2.826589... 1       {'type': 'Polygon', 'coordinates': [[[2.225689... 2       {'type': 'Polygon', 'coordinates': [[[2.225689... 3       {'type': 'MultiPolygon', 'coordinates': [[[[5.... 4       {'type': 'Polygon', 'coordinates': [[[3.933055...                               ...                         2998                                                 None 2999                                                  NaN 3000    {'type': 'Polygon', 'coordinates': [[[5.014937... 3001    {'type': 'Polygon', 'coordinates': [[[4.912995... 3002    {'type': 'Polygon', 'coordinates': [[[4.739631... Name: geom 1, Length: 3003, dtype: object  #Conditionning the dataframe : df.replace('None', np.nan, inplace=True)   I would like to convert these strings to geometries in a GeoDataFrame.   After a few resarches I did not find a working solution :   :  df.loc[:, 'geom 1'] = df.loc[:, 'geom 1'].apply(wkt.loads)  &gt;&gt;&gt; ParseException: Unknown type: '{'TYPE':' WKTReadingError: Could not create geometry because of errors while reading input.    :  df.replace('None', np.nan, inplace=True) geom = [shape(i) for i in df.loc[:, 'geom 1'].dropna()] &gt;&gt;&gt; AttributeError: 'str' object has no attribute 'get'   What I succeded was to sent the DataFrame to PostGIS, convert the type of the column geom 1 from text to geometry and use the function ST_FromGeoJson to access the geometry. Since I have many columns geom I want to do this under python in order to merge all the columns geom into a single one named all_geoms.
117384
I have a PostgreSQL database with the PostGIS extension enabled.  I know that this extension is enabled, since I am using PostGIS functions, and I can actually see the PostGIS functions.  However, PostGIS is not listed in the installed extensions section, and thus I can't alter it nor uninstall it.  If I try  CREATE EXTENSION postgis;   it tells me that PostGIS is already installed, and that I should uninstall it first. However  DROP EXTENSION postgis CASCADE;   tells me that no PostGIS extension is installed.  What can I do? Any ideas?
54886
SQL Server takes an SRID when creating spatial data, but is it possible to retrieve with a different SRID translating the coordinates?  For example, let's say I have a bunch of spatial polygons using SRID 4258, but I'd like to use alongside some pre-existing data that has an SRID of 4326 -- are there built in conversions, or do I have to handle this conversion myself?  The SQL-MM method, which PostGIS implements is . How do I do that in SQL Server?
26957
I was wondering if there is such a thing as an shapefile PRJ to PostGIS SRID lookup table?  Something that can translate the most standard shapefile PRJ definitions into the likely SRID.  When using PostGIS and pgAdminIII, if you use the postgisgui to import your shapefiles, the SRID is left as "-1".  It seems like the tool should be able to parse the Esri PRJ and determine the correct (or at least a couple of options) that are the likely SRID, rather than just leave the default.  Or does the importer have the capability to reproject on the fly if you choose another SRID?  It may seem lazy on my part, but to me it seems curious that this function hasn't already been put in place.  Does anyone know if this concept is in the works, or good reason's why it has been left out?
53578
I want to append some data to a layer in my PostGIS DB using a shapefile, but when I use the Import layer/file tool in QGIS, it doesn't allow me to choose the append option.  Why is this and how do I get it to allow me to append?
56006
I have a table with three points in it and I want to create a line from them using PostGIS.    when I try to create a line from this geometry using:  select id,         st_makeline(geom order by id desc) as geom  from public."point_table" group by id;   I get null geometery    What am I doing incorrectly?  PostGIS version 2.2.1 PostgreSQL version 9.5.1
18408
Does the shapefile support mixed geometry types (ie. point and polygon all in the same file)?
6599
I have to import large Shapefiles (> 1 million records) into PostGIS, and I have been wondering about the best way to do it.    In my question I used the word "hack", instead of tool, on purpose because I think this is not so much a matter of which tool, but which set of steps, or configuration settings to use. So far, I have tried the  plugin (QGIS), the  Postgis tool and the GDAL  tool. You can view my full review on  post. So far, I find all of them really unresponsive, when dealing with a large dataset. I was wondering if someone experienced a similar issue, and if you could share something about the approach.
36831
I have a PostGIS table with geometry column. In this column I have geometries of several types (polygons, points, lines). I publish this this table on GeoServer.  Now I want to create OpenLayers layer with this data.  But how to make a style for this data?  I've already read   and don't want to create gtype in PostGIS if this possible.  I try to create new style within GeoServer but I think that do something wrong:  &lt;?xml version="1.0" encoding="ISO-8859-1"?&gt; &lt;StyledLayerDescriptor version="1.0.0"  xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"  xmlns="http://www.opengis.net/sld"  xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;!-- a Named Layer is the basic building block of an SLD document --&gt;     &lt;Rule&gt;      &lt;ogc:PropertyIsEqualTo&gt;       &lt;ogc:Function name="geometryType"&gt;        &lt;ogc:PropertyName&gt;the_geom&lt;/ogc:PropertyName&gt;       &lt;/ogc:Function&gt;       &lt;ogc:Literal&gt;Polygon&lt;/ogc:Literal&gt;      &lt;/ogc:PropertyIsEqualTo&gt;      &lt;PolygonSymbolizer&gt;        &lt;Stroke&gt;           &lt;CssParameter name="stroke"&gt;#0000ff&lt;/CssParameter&gt;           &lt;CssParameter name="stroke-width"&gt;1&lt;/CssParameter&gt;         &lt;/Stroke&gt;      &lt;/PolygonSymbolizer&gt;     &lt;/Rule&gt; &lt;/StyledLayerDescriptor&gt;   And get a error:  line 10: cvc-complex-type.2.4.a: Invalid content was found starting with element 'Rule'. One of '{"http://www.opengis.net/sld":Name, "http://www.opengis.net/sld":Title, "http://www.opengis.net/sld":Abstract, "http://www.opengis.net/sld":NamedLayer, "http://www.opengis.net/sld":UserLayer}' is expected. line 11: cvc-complex-type.2.4.a: Invalid content was found starting with element 'ogc:PropertyIsEqualTo'. One of '{"http://www.opengis.net/sld":Name, "http://www.opengis.net/sld":Title, "http://www.opengis.net/sld":Abstract, "http://www.opengis.net/sld":LegendGraphic, "http://www.opengis.net/ogc":Filter, "http://www.opengis.net/sld":ElseFilter, "http://www.opengis.net/sld":MinScaleDenominator, "http://www.opengis.net/sld":MaxScaleDenominator, "http://www.opengis.net/sld":Symbolizer}' is expected.   What am I doing wrong?  UPDATE  I try to show a points and make this rule for this geom type:   &lt;Rule&gt;         &lt;ogc:Filter&gt;                     &lt;ogc:PropertyIsEqualTo&gt;                 &lt;ogc:Function name="geometryType"&gt;                     &lt;ogc:PropertyName&gt;the_geom&lt;/ogc:PropertyName&gt;                 &lt;/ogc:Function&gt;                 &lt;ogc:Literal&gt;Point&lt;/ogc:Literal&gt;             &lt;/ogc:PropertyIsEqualTo&gt;         &lt;/ogc:Filter&gt;             &lt;PolygonSymbolizer&gt;         &lt;Stroke&gt;             &lt;CssParameter name="stroke"&gt;#0000ff&lt;/CssParameter&gt;             &lt;CssParameter name="stroke-width"&gt;2&lt;/CssParameter&gt;         &lt;/Stroke&gt;         &lt;/PolygonSymbolizer&gt;     &lt;/Rule&gt;   But not see then on my map. What's wrong?
111138
I have created one table in my PostGIS nut I cannot insert point.  What is wrong with my query?  CREATE TABLE app (    p_id INTEGER PRIMARY KEY  );  SELECT AddGeometryColumn('app','the_geom','4326','POINT',2);  INSERT INTO app(p_id, the_geom) VALUES(2, POINT(-71.060316, 48.432044));   After the last query it shows some error..  ERROR:  column "the_geom" is of type geometry but expression is of type point LINE 1: ...SERT INTO app(p_id, the_geom) VALUES(2, POINT(-71....                                                              ^ HINT:  You will need to rewrite or cast the expression.   ********** Error **********  ERROR: column "the_geom" is of type geometry but expression is of type point SQL state: 42804 Hint: You will need to rewrite or cast the expression. Character: 53   I already check my PostGIS version.   SELECT PostGIS_full_version();   I got the following output..  "POSTGIS="1.5.3" GEOS="3.3.1-CAPI-1.7.1" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.3" USE_STATS"
10112
I am very new to PostGIS/PostgreSQL. In fact, I downloaded it because of the answers I got to this question:   I installed both PostgreSQL and PostGIS. But I am not able to import a shapefile to the database? It gives an error, "Shapefile import failed". What am I doing wrong?