gliderkite
gliderkite

Reputation: 8928

Best way to store a list of points

I want to store (mass storage) a list of points; to be more precise it is a list that contains a number not defined (but not exceeding 200) of groups of coordinates, where each group represents an area (a rectangle). This area could be for example a Rect structure.

What is the best way for me:
In order of importance:

  1. Occupied space in storage memory (obviously less is better).
  2. Ease with which the file is modified (would be better to be able to identify and change the single coordinate, instead of rewrite the entire file due to a change).
  3. Speed ​​reading.
  4. Speed writing.

I already had some ideas on how to set up the work (for example simple text format managed by a custom class, serialization, access database (I can only use an access database), ...), but what is the best solution?

Upvotes: 2

Views: 557

Answers (2)

Reed Copsey
Reed Copsey

Reputation: 564431

This is exactly the problem set addressed by most GIS storage formats. There are many different formats available, all with various advantages and disadvantages.

The OGR project supports many formats for GIS style vector data, nearly all of which support storage of area features with most of the characteristics you're after. One of the "newer" ones here would be ESRI's File Geodatabase format, which is supported in .NET via OGR's C# wrappers.

Alternatively, many database systems, such as SQL Server, PostgreSQL, Oracle, and others support storing spatial data directly in the database. This may be a bit "heavyweight" depending on your needs, but will support very high performance and scalability.

Upvotes: 1

Matthew
Matthew

Reputation: 10444

SQL Server has a native spatial type formats which can be used to store polygons

http://technet.microsoft.com/en-us/library/bb964711
http://technet.microsoft.com/en-us/library/bb895267.aspx

For manipulation, you can load the data into an object to read/modify/validate new points in each polygon.

EDIT: Jason Follas has a good exploration of spatial types here:
http://jasonfollas.com/blog/archive/2008/03/14/sql-server-2008-spatial-data-part-1.aspx

EDIT: I see the OP edited in that he can only use an access database, so my answer no longer applies... but I will leave it as-is in case somebody else finds this question without such a DB limitation.

As for the OP, using only an access database limits your abilities quite a bit.
I would consider two tables: Area and Points with a simple one-to-many relationship.

Upvotes: 1

Related Questions