Blue Theme Orange Theme Green Theme Red Theme
 
Team Foundation Server Hosting
Home | Forums | Videos | Advertise | Certifications | Downloads | Blogs | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
DevExpress UI Controls
Search :       Advanced Search »
Home » ADO.NET & Database » How to Store Spatial Data or Shape Files into RDBMS(PostgreSQL/POSTGIS)

How to Store Spatial Data or Shape Files into RDBMS(PostgreSQL/POSTGIS)

I this article we will see how to store spatial data or shape files into RDBMS.

Page Views : 4882
Downloads : 0
Rating :
 Rate it
Level : Beginner
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
 
Team Foundation Server Hosting
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 


What is Spatial data?

Spatial data is  Also known as Spatial data or geographic information it is the data or information that identifies the geographic location of features and boundaries on Earth, such as natural or constructed features, oceans, and more. Spatial data is usually stored as coordinates and topology, and  those are representing as  Point, Line, Polygon and Raster. Spatial data is often accessed, manipulated or analyzed using Technology called GIS(Geographic Information Systems )

Where Spatial data will store?

The Spatial data is commonly storing in different file formats,that we call as "Geo-database".

What is Shape file?

The shape file is coined by ESRI(Environmental System Research Institute).The shape file stores individual data type(Polygon or line or Point).The shape file is combination of different files (that is from 4 to 5 files combination)
  1. .shp
  2. .shx
  3. .dbf
  4. .xml
  5. .prj
Why Spatial data should store in RDBMS?

The shape files are combination of files,if one file is missed ,the shape file will not work. Those are  just  static files , these files suppose to store in local disc, single user access and the file sometimes can be corrupted or misplaced. So that the data will be lost. The data should store in the database.

How to store shape file into database(RDBMS) ?

There are different steps involved ... that is 
  1. Install PostrgreSQL (Open source) 

    Referred url are 
    http://pginstaller.projects.postgresql.org/
    or
    http://askoh.net/misc/visualworks/installPostgreSQL/

  2. Install PostGIS 
    http://www.gpsfiledepot.com/tutorials/installing-and-setting-up-postgresql-with-postgis/

  3. Set Environment variables for shp2pgsql.exe

    MyComputer --> Properties --> Advanced --> select Environment Variables 

    1.gif

    Set Path variable as above screen.
Convert Shape file to PostgreSQL/POSTGIS :-

2.gif

Run Sql Converted SQL file

3.gif
  
Run the above  Query 

Result of the converted table below screen  :- 

4.gif

We can see the geometry column added in the table in above screen.

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Venkat Rao
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Discover the Top 5 .NET Memory Management Fundamentals
To write the best .NET code, you need to know exactly how the .NET framework really manages memory. Ricky Leeks presents the Top 5 fundamental facts of .NET memory management. Learn more.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
DevExpress Free UI Controls
Become a Sponsor
 Comments
Doing this through a web application without directly using CMD.EXE by vadmal On April 25, 2010
Good article. 
Last year I had a need to do this through a web application  and came across some pretty unique issues. Here's how I solved them
http://codemagician.wordpress.com/2010/04/24/importing-shapefile-into-postgresql-aspnet
Reply | Email | Modify 
Discover the top 5 tips for understanding .NET Interop
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.