Skip to main content
edited tags; edited title
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Issue with GeoJSON data format fetching from PostgresQL

naming
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

Issue with GeoJsonGeoJSON data format fetching from PostgresQL

I am trying to display the GIS data on the Google map using PostgreSQL.

I have few Shapefilesshapefiles, I imported those shapefile into PostgreSQL. Now I am trying to get this data using this query. After running the query I am getting such type of GeoJsonGeoJSON form PostgreSQL I found that the data retrieved from PostgresqlPostgreSQL is not proper format as Google mapMaps accepted. The data is in another format please see my GeoJSON data:

$query="SELECT ST_AsGeoJSON(ST_Transform(geom, 4326)) AS geom_in_degrees FROM pymble_10 ";

$result = pg_query($db,  $query);

  $finalArray = array();
  $i=0;

while($row=pg_fetch_row($result)){

   print_r($row);
 }

And iI am getting output like this :

Array ( [0] =>
{"type":"MultiPolygon","coordinates":[[[[16826527.7094727,-3992350.20318604],[16826530.7548828,-3992351.11029053],[16826532.8928833,-3992352.14691162],[16826534.1887207,-3992353.50750732],[16826535.0958862,-3992355.12738037],[16826535.7437134,-3992356.68231201],[16826535.8084717,-3992357.97821045],[16826535.6140747,-3992359.27398682],[16826534.9663086,-3992360.50512695],[16826534.059082,-3992361.47698975],[16826532.9577026,-3992362.3192749],[16826531.6619263,-3992362.83758545],[16826530.4309082,-3992362.96722412],[16826528.4871216,-3992363.355896],[16826527.2561035,-3992363.6151123],[16826524.145874,-3992364.32788086],[16826521.9431152,-3992365.04058838],[16826520.4528809,-3992365.23492432],[16826518.6386719,-3992364.97570801],[16826517.3428955,-3992363.6151123],[16826516.1118774,-3992361.2177124],[16826516.046875,-3992358.95001221],[16826516.3060913,-3992357.07110596],[16826517.1484985,-3992355.58081055],[16826518.8331299,-3992353.5723877],[16826520.2584839,-3992352.01739502],[16826521.3599243,-3992350.65667725],[16826522.3319092,-3992350.00878906],[16826524.0812988,-3992349.87921143],[16826527.7094727,-3992350.20318604]]]]} )

Issue with GeoJson data format fetching from PostgresQL

I am trying to display the GIS data on the Google map using PostgreSQL.

I have few Shapefiles, I imported those shapefile into PostgreSQL. Now I am trying to get this data using this query. After running the query I am getting such type of GeoJson form PostgreSQL I found that the data retrieved from Postgresql is not proper format as Google map accepted. The data is in another format please see my GeoJSON data:

$query="SELECT ST_AsGeoJSON(ST_Transform(geom, 4326)) AS geom_in_degrees FROM pymble_10 ";

$result = pg_query($db,  $query);

  $finalArray = array();
  $i=0;

while($row=pg_fetch_row($result)){

   print_r($row);
 }

And i am getting output like this :

Array ( [0] =>
{"type":"MultiPolygon","coordinates":[[[[16826527.7094727,-3992350.20318604],[16826530.7548828,-3992351.11029053],[16826532.8928833,-3992352.14691162],[16826534.1887207,-3992353.50750732],[16826535.0958862,-3992355.12738037],[16826535.7437134,-3992356.68231201],[16826535.8084717,-3992357.97821045],[16826535.6140747,-3992359.27398682],[16826534.9663086,-3992360.50512695],[16826534.059082,-3992361.47698975],[16826532.9577026,-3992362.3192749],[16826531.6619263,-3992362.83758545],[16826530.4309082,-3992362.96722412],[16826528.4871216,-3992363.355896],[16826527.2561035,-3992363.6151123],[16826524.145874,-3992364.32788086],[16826521.9431152,-3992365.04058838],[16826520.4528809,-3992365.23492432],[16826518.6386719,-3992364.97570801],[16826517.3428955,-3992363.6151123],[16826516.1118774,-3992361.2177124],[16826516.046875,-3992358.95001221],[16826516.3060913,-3992357.07110596],[16826517.1484985,-3992355.58081055],[16826518.8331299,-3992353.5723877],[16826520.2584839,-3992352.01739502],[16826521.3599243,-3992350.65667725],[16826522.3319092,-3992350.00878906],[16826524.0812988,-3992349.87921143],[16826527.7094727,-3992350.20318604]]]]} )

Issue with GeoJSON data format fetching from PostgresQL

I am trying to display the GIS data on the Google map using PostgreSQL.

I have few shapefiles, I imported those shapefile into PostgreSQL. Now I am trying to get this data using this query. After running the query I am getting such type of GeoJSON form PostgreSQL I found that the data retrieved from PostgreSQL is not proper format as Google Maps accepted. The data is in another format please see my GeoJSON data:

$query="SELECT ST_AsGeoJSON(ST_Transform(geom, 4326)) AS geom_in_degrees FROM pymble_10 ";

$result = pg_query($db,  $query);

  $finalArray = array();
  $i=0;

while($row=pg_fetch_row($result)){

   print_r($row);
 }

And I am getting output like this :

Array ( [0] =>
{"type":"MultiPolygon","coordinates":[[[[16826527.7094727,-3992350.20318604],[16826530.7548828,-3992351.11029053],[16826532.8928833,-3992352.14691162],[16826534.1887207,-3992353.50750732],[16826535.0958862,-3992355.12738037],[16826535.7437134,-3992356.68231201],[16826535.8084717,-3992357.97821045],[16826535.6140747,-3992359.27398682],[16826534.9663086,-3992360.50512695],[16826534.059082,-3992361.47698975],[16826532.9577026,-3992362.3192749],[16826531.6619263,-3992362.83758545],[16826530.4309082,-3992362.96722412],[16826528.4871216,-3992363.355896],[16826527.2561035,-3992363.6151123],[16826524.145874,-3992364.32788086],[16826521.9431152,-3992365.04058838],[16826520.4528809,-3992365.23492432],[16826518.6386719,-3992364.97570801],[16826517.3428955,-3992363.6151123],[16826516.1118774,-3992361.2177124],[16826516.046875,-3992358.95001221],[16826516.3060913,-3992357.07110596],[16826517.1484985,-3992355.58081055],[16826518.8331299,-3992353.5723877],[16826520.2584839,-3992352.01739502],[16826521.3599243,-3992350.65667725],[16826522.3319092,-3992350.00878906],[16826524.0812988,-3992349.87921143],[16826527.7094727,-3992350.20318604]]]]} )
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edit code format
Source Link
Kersten
  • 9.9k
  • 3
  • 39
  • 59

I am trying to display the GIS data on the Google map using the PostgreSQL.

I have few ShapefileaShapefiles, I imported those shapefile into POstgresQLPostgreSQL. Now I am trying to get this data using this query. After running the query I am getting such type of GeoJson form PostgreSQL I found that the data retrieved from Postgresql is not proper format as Google map accepted. The data is in another format please see my GeoJSON data:

$query="SELECT ST_AsGeoJSON(ST_Transform(geom, 4326)) AS geom_in_degrees FROM pymble_10 ";

$result = pg_query($db,  $query);

  $finalArray = array();
  $i=0;

while($row=pg_fetch_row($result)){

   print_r($row);
 }
$query="SELECT ST_AsGeoJSON(ST_Transform(geom, 4326)) AS geom_in_degrees FROM pymble_10 ";

$result = pg_query($db,  $query);

  $finalArray = array();
  $i=0;

while($row=pg_fetch_row($result)){

   print_r($row);
 }

Array ( [0] => {"type":"MultiPolygon","coordinates":[[[[16826527.7094727,-3992350.20318604],[16826530.7548828,-3992351.11029053],[16826532.8928833,-3992352.14691162],[16826534.1887207,-3992353.50750732],[16826535.0958862,-3992355.12738037],[16826535.7437134,-3992356.68231201],[16826535.8084717,-3992357.97821045],[16826535.6140747,-3992359.27398682],[16826534.9663086,-3992360.50512695],[16826534.059082,-3992361.47698975],[16826532.9577026,-3992362.3192749],[16826531.6619263,-3992362.83758545],[16826530.4309082,-3992362.96722412],[16826528.4871216,-3992363.355896],[16826527.2561035,-3992363.6151123],[16826524.145874,-3992364.32788086],[16826521.9431152,-3992365.04058838],[16826520.4528809,-3992365.23492432],[16826518.6386719,-3992364.97570801],[16826517.3428955,-3992363.6151123],[16826516.1118774,-3992361.2177124],[16826516.046875,-3992358.95001221],[16826516.3060913,-3992357.07110596],[16826517.1484985,-3992355.58081055],[16826518.8331299,-3992353.5723877],[16826520.2584839,-3992352.01739502],[16826521.3599243,-3992350.65667725],[16826522.3319092,-3992350.00878906],[16826524.0812988,-3992349.87921143],[16826527.7094727,-3992350.20318604]]]]} )

Array ( [0] =>
{"type":"MultiPolygon","coordinates":[[[[16826527.7094727,-3992350.20318604],[16826530.7548828,-3992351.11029053],[16826532.8928833,-3992352.14691162],[16826534.1887207,-3992353.50750732],[16826535.0958862,-3992355.12738037],[16826535.7437134,-3992356.68231201],[16826535.8084717,-3992357.97821045],[16826535.6140747,-3992359.27398682],[16826534.9663086,-3992360.50512695],[16826534.059082,-3992361.47698975],[16826532.9577026,-3992362.3192749],[16826531.6619263,-3992362.83758545],[16826530.4309082,-3992362.96722412],[16826528.4871216,-3992363.355896],[16826527.2561035,-3992363.6151123],[16826524.145874,-3992364.32788086],[16826521.9431152,-3992365.04058838],[16826520.4528809,-3992365.23492432],[16826518.6386719,-3992364.97570801],[16826517.3428955,-3992363.6151123],[16826516.1118774,-3992361.2177124],[16826516.046875,-3992358.95001221],[16826516.3060913,-3992357.07110596],[16826517.1484985,-3992355.58081055],[16826518.8331299,-3992353.5723877],[16826520.2584839,-3992352.01739502],[16826521.3599243,-3992350.65667725],[16826522.3319092,-3992350.00878906],[16826524.0812988,-3992349.87921143],[16826527.7094727,-3992350.20318604]]]]} )

I am trying to display the GIS data on the Google map using the PostgreSQL.

I have few Shapefilea, I imported those shapefile into POstgresQL. Now I am trying to get this data using this query. After running the query I am getting such type of GeoJson form PostgreSQL I found that the data retrieved from Postgresql is not proper format as Google map accepted. The data is in another format please see my GeoJSON data:

$query="SELECT ST_AsGeoJSON(ST_Transform(geom, 4326)) AS geom_in_degrees FROM pymble_10 ";

$result = pg_query($db,  $query);

  $finalArray = array();
  $i=0;

while($row=pg_fetch_row($result)){

   print_r($row);
 }

Array ( [0] => {"type":"MultiPolygon","coordinates":[[[[16826527.7094727,-3992350.20318604],[16826530.7548828,-3992351.11029053],[16826532.8928833,-3992352.14691162],[16826534.1887207,-3992353.50750732],[16826535.0958862,-3992355.12738037],[16826535.7437134,-3992356.68231201],[16826535.8084717,-3992357.97821045],[16826535.6140747,-3992359.27398682],[16826534.9663086,-3992360.50512695],[16826534.059082,-3992361.47698975],[16826532.9577026,-3992362.3192749],[16826531.6619263,-3992362.83758545],[16826530.4309082,-3992362.96722412],[16826528.4871216,-3992363.355896],[16826527.2561035,-3992363.6151123],[16826524.145874,-3992364.32788086],[16826521.9431152,-3992365.04058838],[16826520.4528809,-3992365.23492432],[16826518.6386719,-3992364.97570801],[16826517.3428955,-3992363.6151123],[16826516.1118774,-3992361.2177124],[16826516.046875,-3992358.95001221],[16826516.3060913,-3992357.07110596],[16826517.1484985,-3992355.58081055],[16826518.8331299,-3992353.5723877],[16826520.2584839,-3992352.01739502],[16826521.3599243,-3992350.65667725],[16826522.3319092,-3992350.00878906],[16826524.0812988,-3992349.87921143],[16826527.7094727,-3992350.20318604]]]]} )

I am trying to display the GIS data on the Google map using PostgreSQL.

I have few Shapefiles, I imported those shapefile into PostgreSQL. Now I am trying to get this data using this query. After running the query I am getting such type of GeoJson form PostgreSQL I found that the data retrieved from Postgresql is not proper format as Google map accepted. The data is in another format please see my GeoJSON data:

$query="SELECT ST_AsGeoJSON(ST_Transform(geom, 4326)) AS geom_in_degrees FROM pymble_10 ";

$result = pg_query($db,  $query);

  $finalArray = array();
  $i=0;

while($row=pg_fetch_row($result)){

   print_r($row);
 }
Array ( [0] =>
{"type":"MultiPolygon","coordinates":[[[[16826527.7094727,-3992350.20318604],[16826530.7548828,-3992351.11029053],[16826532.8928833,-3992352.14691162],[16826534.1887207,-3992353.50750732],[16826535.0958862,-3992355.12738037],[16826535.7437134,-3992356.68231201],[16826535.8084717,-3992357.97821045],[16826535.6140747,-3992359.27398682],[16826534.9663086,-3992360.50512695],[16826534.059082,-3992361.47698975],[16826532.9577026,-3992362.3192749],[16826531.6619263,-3992362.83758545],[16826530.4309082,-3992362.96722412],[16826528.4871216,-3992363.355896],[16826527.2561035,-3992363.6151123],[16826524.145874,-3992364.32788086],[16826521.9431152,-3992365.04058838],[16826520.4528809,-3992365.23492432],[16826518.6386719,-3992364.97570801],[16826517.3428955,-3992363.6151123],[16826516.1118774,-3992361.2177124],[16826516.046875,-3992358.95001221],[16826516.3060913,-3992357.07110596],[16826517.1484985,-3992355.58081055],[16826518.8331299,-3992353.5723877],[16826520.2584839,-3992352.01739502],[16826521.3599243,-3992350.65667725],[16826522.3319092,-3992350.00878906],[16826524.0812988,-3992349.87921143],[16826527.7094727,-3992350.20318604]]]]} )
Source Link
Loading