[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
www.undertowsoftware.com • View topic - Questions on new polygons project

Questions on new polygons project

A forum made available for users of the MapPro OCX SDK to exchange ideas, ask each other questions, etc.

Questions on new polygons project

Postby jimwelch » Wed Feb 08, 2012 10:12 am

I have a lot of polygons representing commercial lots that my company is managing in a number of states. These are provided in a variety of forms. Some are from local GIS departments in shape file format, others are in image formats (aerial pictures, or screen captures, etc., and others in plain old paper format. I want to create a simple management system, so that I can draw all these polygons on the map, group them by the office that manages them (may be by color ??), so that I can make their manager a bit more automated.

Any pointers as to what may be the best way to approach this project? I am wondering if anyone has done something similar and are willing to share their experience.
User avatar
jimwelch
Active User
Active User
 
Posts: 20
Joined: Mon Feb 06, 2012 10:55 pm

Re: Questions on new polygons project

Postby Gyrotech » Wed Feb 08, 2012 3:19 pm

jimwelch wrote:I have a lot of polygons representing commercial lots that my company is managing in a number of states. These are provided in a variety of forms. Some are from local GIS departments in shape file format, others are in image formats (aerial pictures, or screen captures, etc., and others in plain old paper format. I want to create a simple management system, so that I can draw all these polygons on the map, group them by the office that manages them (may be by color ??), so that I can make their manager a bit more automated.

Any pointers as to what may be the best way to approach this project? I am wondering if anyone has done something similar and are willing to share their experience.

It's hard to tell you how/what to do, because a lot of what you do will probably depend on the specific needs you have, rather than the general description of what you are trying to do. As they say, the devil is in the details :-)

I've done dozens of similar small projects and I had to use a different approach in each one of them. For some of them, I have just imported the provided shp files. For others, I used the coordinates to create polygons using the CAD capabilities, and so on... However, here are a few simple pointers that may help you (if not, you can just ignore them <smile>).

- The CAD options are good for handling polygons where you want to control individual colors, labeling, etc., but I probably wouldn't recommend it for handling "large numbers" of polygons. A caveat here, some of this info is based on work I have done with MapPro71, undertow may have made the process more efficient in MapPro80.

- If all (most) of your data is in SHP format, then using the ImportMgr may be your best bet. The good thing about it is that it's all managed for you and in MapPro80 the ImportMgr lets you specify where to draw it (above or below another set of polygons - though I haven't tried this) and more importantly, lets you set the degree of transparency (I have tried this). It also lest you select differen colors for each set of polygons. This method will also allow you to add images representing polygons as long as you can get the Lat/Lon coordinates of the bounding polygon of the image and add them to a .SAT file (I believe they document how to create the .SAT file, it's a simple text file).

- As for the paper data, you have to either scan them and use the image method, or if you have the coordinates, depending on what you are trying to do, you might even create them as CAD objects and use a combination of the methods above.

Hope this helps.
User avatar
Gyrotech
Frequent User
Frequent User
 
Posts: 52
Joined: Mon May 03, 2010 11:23 pm

Re: Questions on new polygons project

Postby FletcherJ » Thu Feb 09, 2012 7:26 pm

Jim,

I am fairly new to this, so other may have better ideas....

jimwelch wrote:I have a lot of polygons representing commercial lots that my company is managing in a number of states. These are provided in a variety of forms. Some are from local GIS departments in shape file format, others are in image formats (aerial pictures, or screen captures, etc., and others in plain old paper format. I want to create a simple management system, so that I can draw all these polygons on the map, group them by the office that manages them (may be by color ??), so that I can make their manager a bit more automated.


My thought would be to have a common format for your polygons. As pointed out by Gyrotech, the CAD is a good way to do it. But you also have to support external files, etc.

I would probably pick a format for a file structure (SHP, MIF, etc.) and then create a manager that converts all the various types to that format. Then your main application only needs to deal with one format. With a file format, you simply tell the ocx which file you want and it sucks in all the data (vs. the CAD that requires you provide an array and then load each polygon at a time, etc.)

In my case, I get data either as a set of points or via an XML file. I am considering writing a routine that will convert those to MIF files and then just use MIF files. This also makes it easier to bring in data as the MIF is at least a documented and (apparently) actively used file format.

For the pictures, you will probably want to use the importMgr.

If you want any code samples, etc. for working with MIF, let me know. The book has some in VB and I have some I have built in C# while evaluating MIF as an option.

Take care,

me
User avatar
FletcherJ
Active User
Active User
 
Posts: 36
Joined: Fri Jan 20, 2012 5:33 pm

Re: Questions on new polygons project

Postby jimwelch » Fri Feb 10, 2012 2:17 am

Thanks to all the feedback. I'm still struggling with how to do it and what to use as the basis, but as I start working with the various data, I can see what gyrotech is saying, it depends on what I want. One of the main consideration is the ability to manage the various polygons individually, which I guess answers my question. The only format that would allow me to click on a polygon/plot plan, and select it, highlight it, etc. would be the CAD option. If I understand the documentation correctly, all other imported formats do not allow me to select individual objects on them.

@FletcherJ, what do you mean if I need MIF code? If you are referring to "how to import" a MID/MIF file pair to MapPro80, that's kinda trivial. If you are offering code that would accept coordinates and create MID/MIF files, that's not all that hard, either. But, if you are referring to some other type of MID/MIF processing code, I am all ears :-)

BTW, MID/MIF is a "barely" active format. It was, may be 150 - 20 years ago, but its creator, MapInfo, is no longer the king of mapping it used to be, and its format is not being used as much.
User avatar
jimwelch
Active User
Active User
 
Posts: 20
Joined: Mon Feb 06, 2012 10:55 pm

Re: Questions on new polygons project

Postby Gyrotech » Sun Feb 12, 2012 10:41 am

Jimwelch, at the end you'll decide what's best for your situation. However, in my mind, there are some simple guidelines. If your data is coming from a different source and they are in shp or mif format, then you should use them. If your data is in some "other" format and you have to process them to use them in MapPro or if you have a need to manage the data in each layer individually, then a CAD format is better. I actually used to create files in the old CMX format, but undertow stopped developing it when they moved to the CAD format and I didn't want to get caught using an unsupported format. I think it's still documented in their later documentation, if you want to use it.
User avatar
Gyrotech
Frequent User
Frequent User
 
Posts: 52
Joined: Mon May 03, 2010 11:23 pm

Re: Questions on new polygons project

Postby jimwelch » Mon Feb 13, 2012 11:05 am

I'm still fighting with this :-(

I have large files with many polygons. For example one of the files has about 60,000 points, defining about 8,000 polygons. The points are arranged in repeating sequences like,

N
X1,Y1
X2,Y2
..
..
XN,YN

where N is the number of points in the polygon and X1,X2... are the coordinates of each point. I think I've set up the routine to read the points and create the CAD polygons correctly, but I am not sure. It's very tedious to define all these individual arrays, one for each polygon, and tnam manage them, so I'm almost sure I am screwing up somewhere, but I'll be darned if I can figure out where. All I know is that whatever I am doing is not working.

Can anyone give me a hand, in C#, or VB.NET, or any language at this point :-(
User avatar
jimwelch
Active User
Active User
 
Posts: 20
Joined: Mon Feb 06, 2012 10:55 pm

Re: Questions on new polygons project

Postby Gyrotech » Tue Feb 14, 2012 10:41 am

I am not sure I understand your dilemma! The best way to do it would be to read all the coordinates into a single array and the counts of points into a different array and then make the needed cad calls to create the polygons.
User avatar
Gyrotech
Frequent User
Frequent User
 
Posts: 52
Joined: Mon May 03, 2010 11:23 pm

Re: Questions on new polygons project

Postby jimwelch » Tue Feb 14, 2012 3:37 pm

It all sounds simple, but i am somehow stuck :-( Is there any information in the mappro80 manual that you could point me to, which might help me with this task?

Thank you
User avatar
jimwelch
Active User
Active User
 
Posts: 20
Joined: Mon Feb 06, 2012 10:55 pm

Re: Questions on new polygons project

Postby Gyrotech » Wed Feb 15, 2012 10:17 am

Read all the information in two arrays, one Pts[i=1..N,j=1..N] that holds the points and one Cts[i=1..N] that holds the counts, i.e., how many points in the first polygon, how many in the second polygon, etc.

Then, set up a loop that calls the CAD object and creates the polygons. (this is just some sample code I just typed in without running it, make sure you adopt it to your needs)

// Start with the first count of points
iStart=1
// Repeat for all counts
for (int i = 1; i <= N; i++)
{
.CAD.Polygon[Pts[iStart],Cts[i]]
// Set the starting point in the array for the next polygon
iStart=iStart + Cts[i]
}
User avatar
Gyrotech
Frequent User
Frequent User
 
Posts: 52
Joined: Mon May 03, 2010 11:23 pm

Re: Questions on new polygons project

Postby FletcherJ » Wed Feb 15, 2012 2:35 pm

Jim,

I use the ImportMgr options to import the data I need. Depending on the format of your data files, this may work for you. In my case, when I add the data, the data that needs to be configured separately from the others gets loaded on a different layer.

This is similar to the way the CAD feature works, except that the CAD polygon assumes you already have the data and can just pass it to the polygon method.

Once I have added a given layer, I can specify the color, visibility, etc. for that layer.

My recommendation is to start with the sample in the book, get that working, then modify it to work with you. I have found that, in some cases, I have been beating my head against the wall trying to get the code working. But when I start with an example which does work, then it's much easier to tweak that to do what I need.

If you are using C#, then let me know so I can give you some heads up as most of the examples are in VB and there are a couple of gotchas that aren't obvious when converting the code.

Take care,

me
User avatar
FletcherJ
Active User
Active User
 
Posts: 36
Joined: Fri Jan 20, 2012 5:33 pm

Re: Questions on new polygons project

Postby jimwelch » Wed Feb 15, 2012 11:12 pm

Thanks, FletcherJ. I might take you up on the C# stuff, when the time comes.

One thing I don;t understand in your comments. You said that using the CAD to import the data presumes I already have the data. Well, I do, as I said, I get it from another process, in the format I specified earlier. So what am I missing?
User avatar
jimwelch
Active User
Active User
 
Posts: 20
Joined: Mon Feb 06, 2012 10:55 pm

Re: Questions on new polygons project

Postby Gyrotech » Thu Feb 16, 2012 1:40 pm

Jimwelch:

Based on what you have said so far, I still maintain that CAD will give you the solution, flexibility and object control you want. If you are already getting your files in the form you suggested, why would you read them in, convert them to some obscure (MID/MIF ??) file format to then import it into the OCX and only be able to manage is a blob? What is the purpose of that?

Read all the points into an array and then define the CAD polygons as I proposed earlier.
User avatar
Gyrotech
Frequent User
Frequent User
 
Posts: 52
Joined: Mon May 03, 2010 11:23 pm


Return to MapPro OCX

Who is online

Users browsing this forum: No registered users and 1 guest

cron