Jump to content

 
Photo

how two merge two different geometry shape(.shp) file

- - - - -

  • Please log in to reply
6 replies to this topic

#1
ankit

ankit

    Newbie

  • New Member
  • Pip
  • 1 posts
  • India

hi can any body know
how two merge two different geometry shape(.shp) file.

#2
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,862 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

hi can any body know
how two merge two different geometry shape(.shp) file.


You mean merging a polygon shapefile with a polyline shapefile? That's easy: you can't. One of the limitations of the shapefile format is that it can only hold one type of geometry per file.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#3
spg

spg

    Contributor

  • Validated Member
  • PipPip
  • 17 posts
  • New Zealand

As Hans says, you can't do anything with different types.

BUT, depending on what you want to use your output for you might be able to make something out of it.
If you are merging polygon and polyline you have two options: convert polygons to polyline or VV so they are the same geometry type, then merge.
If going to point geometry you might be able to get usable results if you convert the poly to vertices or similar first.

Alternatively, some GIS like MapInfo will allow you to mix and match geometry types in one table.

#4
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,301 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

The question is - why do you want to do this?
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#5
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,862 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

The question is - why do you want to do this?


Well... I can think of some potential uses. Take for example a road centerline file, for an area which also contains plazas. I'd really like to have those as actual polygons, rather than a line that runs around it. Then again, getting that to visualise automatically is probably not easy to set up.
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#6
James Hines

James Hines

    James Anthony Hines

  • Validated Member
  • PipPipPipPipPipPip
  • 536 posts
  • Gender:Male
  • Location:Centreville, Nova Scotia
  • Interests:Cartography, Philosophy, Politics, Psychology, Economics, Occultism, Spiritualism
  • Canada

The question is - why do you want to do this?


Well... I can think of some potential uses. Take for example a road centerline file, for an area which also contains plazas. I'd really like to have those as actual polygons, rather than a line that runs around it. Then again, getting that to visualize automatically is probably not easy to set up.

I think in that case the user is better off learning how to design a database, creating a relationships when they exist, & learning topological rules. For example using centreline roads & plaza boundaries. No relationship is required in this case because the road centrelines should be placed in one feature set; lets call it "Transportation" & plaza boundaries should be put in another; lets call it "Infrastructure." No relationship is possible between these two files unless you used topology to create a road polygon in which you could either use "street name" as a relationship column or "RdID."

In the case of centreline roads & plaza boundaries we have to think of topology where with the proper tools you can simply make those lines into polygons & back provided that your license doesn't have that kind of restriction. Noted that I will recommend topology to extend & trim road lines looking for undershoots & dangles but not to build polygons.

Ultimately I think the user trying to setup a single shapefile pf both lines & polygons which at the moment is asking for a method that is not possible at the moment & instead should focus on learning how to place these features into a spatial database where in a GIS he can simply find the features & download them into his GIS system. If ESRI was to create such a feature in a shapefile allowing for multiple geometry types then we are asking for a legacy way of working a GIS. Cartographic (Geographic Scientific Design) engineering is the future of our field.

"There is much beauty that we fail to see through our own eyes teeming with life forms that give us that perception of our reality.  Leaves on the trees blowing gently in the wind, or scarily, the waves pounding through high surf, or lightly on a warm summer’s day; that opportunity to sit or swim in the water on a white beach.   That comfort to shout, “The universal conscious do you hear me?  I am alive, guide me dear logos towards the path of rightnesses.”  Earned what has been kept, no longer to be absorbed into a life filled with cold damn winds and  that stubborn fog clouding  my vision with nothing but darkness."


#7
M.Denil

M.Denil

    Key Contributor

  • Validated Member
  • PipPipPip
  • 56 posts
  • United States

... sometimes I really miss coverages. But only sometimes.

As has been pointed out, there are a variety of work-arounds but one needs to know why ankit wants to do this in order to give appropriate advise.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->