Ned,

 

Try this out in the DK immediate execution box.  I recommend trying it with a small selection set first, to test it out.  It requires that you have a folder called “Map Images” in the root of your C: drive, or you can modify the code to change the path for the saved images.

 

FYI, this will work with any layer, so long as there is a “Name” field in the layer’s data.

 

//store original settings

workingselection=getlayer()+"|Selection"

workinglayer=getlayer()+"|"

oldscope=getmapscope(getmap())

 

//count areas and get started

numareas=getsetcount("Selection")

dim arealist[numareas]

dim sz[2]

arealist=getsetids(workingselection)

 

//Create Progress Bar

EnableProgressBar("Batch Maps - " + string(numareas), 1)

CreateProgressBar("Creating Map...", "True")

           

for areanum=1 to numareas do

            currentarea=arealist[areanum]

            selectbyids("Selection","Several",{currentarea})

            rh=id2rh(currentarea)

            myscope=getrecordscope(rh)

            setmapscope(getmap(),myscope)

            sz=getscoperect(getrecordscope(rh))

            activelayer=getlayer()

            setrecord(activelayer,rh)

            jpegname="c:\\Map Images\\" + activelayer.("Name")+ ".jpg"

            SaveMapToImage(, jpegname, "JPEG",  {{"Quality", -300}})

           

stat = UpdateProgressBar("Map Number " + String(areanum), r2i((areanum/numareas)*100))

            if stat = "True" then do

                        ShowMessage("Oops!  Try again.")

                        goto quit_loop

                        end

End

 

quit_loop:

DestroyProgressBar()

 

//restore original settings

setmapscope(getmap(),oldscope)

selectbyids("Selection", "Several", arealist)

 

Redrawmap()

________________________
Jason Black
Missouri Republican Party
IT Director
[EMAIL PROTECTED]
204 E. Dunklin
Jefferson City, MO  65101
Phone:  (573) 636-3146
Fax:  (573) 636-3273
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯


From: [email protected] [mailto:[email protected]] On Behalf Of Ned Hawley
Sent: Wednesday, May 24, 2006 12:52 AM
To: [email protected]
Subject: Re: [Maptitude] Batch File Creation

 

Armando:

I appreciate the information, but my goal is not data aggregation. Rather, it is to automate the process of creating and saving thousands of individual maps.

Since you asked, ccplace.cdf is the default layer in terms of defining scale, as it automatically scales to the city boundaries. The issue is that there are over 20,000 such records in that layer. I'd like to create a macro that will take a map template (with several other layers included) and create and save individual maps (JPEGs or GIFs) for each and every record as opposed to manually creating 20,000+ maps.

Hope that better explains the objective.

Thanks, Ned

On 5/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Ned,

It sounds like your first step is to define clearly the limits of each city

If you have got a polygon layer with city limits, then you will be able to batch print your maps using Maptitudes Distric Reporting.

If you onyl have a point layer with city names, then you need to specify a scale for each city, or create polygons around each layer before .

Another option is to obtain city limits information from other sources by aggreagating multiple polygons.  The Census Places file or the 5-Digit Zip Code files in the ccdata directory (isntalled by Maptitude) sound like good candidates, but also Census Tracts, CBSA Diviosn.

Finally, if you have somethign like a clients layer with city information for eahc city, you shoudl be able to create polygons emcompassing all clients from a same city, or create a DK script to scope maps based on selection sets of clients from the same city.

Once you have the city poligons defined, your are on your way to creating a batch job.

Good luck.

Armando




---------------------------------------

Does anyone have experience with creating batch maps for different
geographic locations based on a single template? I need to create maps
for thousands of cities & towns across the U.S. and would like to
expedite the process by getting Maptitude/GISDK to go sequentially
through the ccplace2000 layer to create and save the individual maps.

Any input or sample macro would be appreciated.

Thanks, NH


-------------

SPONSORED LINKS

Geographic information systems

Geography game

Geography

 


YAHOO! GROUPS LINKS

 

 






SPONSORED LINKS
Geographic information systems Geography game Geography


YAHOO! GROUPS LINKS




Reply via email to