Hi All
I just tried to read in a shapefile using plmap and hit some snags. I thought I would check the best route before I submitted a patch.

The first snag was the fact that the shapefile contains a map projection rather than lats and lons. Unfortunately plmap assumes lats and lons and does a few things to deal with wraparound and the fact that data and plot scales may use either -180 to +180 or 0 to 360 scales for longitude. When dealing with a map projection this all falls apart.
The second snag was that the shapefile contains multiple line items representing different items (some are height contours, some are water boundaries). Of course I would ideally plot these in different colours or styles, however plmap currently just reads every line item from the shapefile and plots it with the current line properties.

When I added the shapefile support we had some discussion about how far to go and whether it was worth supporting more complex shapelib files. The changes to plplot that would be needed to fix the above items would require either a change to plmap or an overload of plmap which provided an option to turn x-direction (longitude) wrapping on or off and a parameter to provide the indices of the shapefile items to draw. The question is whether such a change is worth it if it breaks existing code.

Of course I could simply read the shapefile in my own code and pass the read data to plline to draw, but I thought that if I was going to do that then I would offer to incorporate that code into Plplot for others to use too.

Perhaps if we leave things as is then the documentation should state that the shapefile data must be lats and lons, although I just scanned the documentation and it doesn't mention the shapefile support in plmap.

Phil