ArcGIS – Cannot map metafile into memory. Not enough memory

Well this little error message really annoys me, I’ve just finished a large map (often A1) and all I want to do is print or export it (jpg or pdf). 

Often I find it better to export as a pdf so I don’t need to load up ArcGIS again just to print a copy off.

Anyway as my maps get bigger (and hopefully better) so to do I see this error message more often.

The worst thing is the solution, basically I have to reboot my computer and as soon its loaded and before I do anything else load my map up in ArcGIS and either print or export it.  It’s also a one shot deal so once I’ve done this I can’t re-printexport without a reboot.

I’ve followed a thread on the ESRI support site (great for support issues, but a bit hard to navigate), you can find it here : http://forums.esri.com/Thread.asp?c=93&f=1731&t=248490

The thread has been going since the 9th March 2008, and the last post as of now was the 30th March.   Many solutions posted talk about editing the registry (or doing a reboot), and ESRI has said that the last service update should have fixed some peoples problems (but not mine apparently).

My feeling is that editing the registry manually should not be considered a solution (couldn’t someone write a small program to do it for me safely??).

Anyway I hope you didn’t come here to find the solution as the thread I link to in the support forum is all I’ve got, people have solved it for themselves but I guess it depends what you do for mapping.

Leave a comment or message me (I’m on Twitter you know..) if you have any solutions I might try, and no I don’t want to edit the registry OR reboot!

Word Documents in ArcGIS layouts – Nicer fonts in ArcGIS Layouts

Okay, lots of people may know how to do this but I didn’t until today so I thought I’d share it.   Basically I wanted properly formatted text (nice fonts, colours lists etc..) on a Layout I was working on.

This works in my case with ArcGIS 9.3.1 (my case ArcMAP) and Word 2007

  1. Select Insert on the File menu and select “Insert Object”
  2. Check Create New option and scroll down to and select “Microsoft Office Word Document”
  3. Click Okay
  4. Word should open up and you can start typing away!
  5. Once you are finished click the round office button and select Update
  6. When you close word the text box in your Layout View will go clear.

I hope this helps, you may also notice that the text box you create is too wide and that resizing it shrinks the text and the box.   If you would like the text box’s width to be narrower:

  1. Double-click your text box to open Word again.
  2. With the rulers in Word on adjust the text column width to suit your needs.
  3. Now click update and you should see it change

If you need help with these instructions please leave a comment or message me, I’ve written it rather quickly at work so I remember how to do it as well!

Geotagged Photos from Picasa into ArcGIS (for HTML popups)

Okay I’m probably blind but I’ve been trying to find a way of placing already geotagged images in ArcGIS in batches.  My hope was to either add natively my geotagged image into ArcGIS or to export these from say Google Earth to ArcGIS.

Well I found a way but I’m not sure its the quickest or easiest so perhaps if I post this here someone will see it and make suggestions.  Or more than likely point me to a free script/addin/extension that has done this from day one!.

Okay pleased be patient, this is more of a principles rather than detailed description and assumes knowledge of the software involved.

Required: Google Picasa and Earth, ArcGIS Explorer (plus Geotag Add In), ArcGIS (in my case ArcMAP) and MS Excel (I’m using 2007)

  1. Use Picasa and Google Earth to Geotag your photos, you can get help here.
  2. Install Geotag Add in for ArcExplorer find it here.
  3. Use the Geotag Add In, to add your now geotagged photos.
  4. Save your geotagged map in ArcExplorer as a *.nmf file
  5. Open this nmf file in Excel as a XML file, I suggest you save this immediatley as a CSV once completed (as Excel seemed to be buggy with me).
  6. In Excel remove all the columns and strip the data (if you had extra layers) until you are left with the XY values and the html code (content) which contains the location of your geotagged image.
  7. The tricky bit here is turning the html code in the content column into something useable I used the following 3 stage formula proces to get something that the HTML popup in ArcGIS would like:
  8. =MID(C2, FIND(“=”,C2)+10, 77)
  9. =SUBSTITUTE(H2,CHAR(34),” “)
  10. =CONCATENATE(‘img tag’!$B$2,I2,’img tag’!$D$2)
  11. Basically the first one takes file location with some extra characters from the Content column, then the second one replaces removes a “, these two create a clean location of the image (c:\images\photo1.jpg)
  12. The third one takes two cells (placed on a seperate tab) that I have put some HTML code into:
    <img border =1 src=”
    and
    ” width=”307.2″ height =”230.4″ />
    wraps it up so you get this: <img border =1 src=”c:\images\photo1.jpg” width=”307.2″ height =”230.4″ /> .
  13. Okay once this is done and your table looks something like this
     
  14. Open ArcGIS and Add your XY Data, you should have dots where your photos were geolocated!
  15. Next export your added data as a shapefile or geodatabase.
  16. You should then using ArcToolbox in ArcCatalog ensure that this new file has a coordinate system of WGS 1984 (just check in ArcExplorer what system is used, in fact back in Excel you might have seen that column).
  17. Now back in ArcGIS add your new layer, voila!  Right click and select properties on your new layer and under the field tab switch on and off the fields you want display in your html popup.
  18. Now select the HTML popup tab, check “Show content for this layer using the HTML Popup tool”, and click Verify (it should give you an example of what it will look like!  
  19. Now you can stop there, but if you want to do some formatting of this HTML popup you can check  “As formatted page based on an XSL template” and copy in the popup.xsl code (open in notepad) located here :”driveletter:\Program Files (x86)\ArcGIS\Styles\HTMLPopup”.  I know very little about this file but I know its okay to edit the HTML code highlighted in orange:

<?xml version=”1.0″ encoding=”UTF-8″?>
<xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns:fo=”http://www.w3.org/1999/XSL/Format”>
    <xsl:template match=”/”>
        <html>
        <body leftmargin=”0″ topmargin=”0″ bottommargin=”0″ rightmargin=”0″>
          <font face=”Calibri”>
            <xsl:variable name=”nameCol” select=”FieldsDoc/Fields/Field/FieldName”/>
            <table border=”5″ width=”300″ cellpadding=”5″ cellspacing=”0″>
                <tr bgcolor=”#9CBCE2″>
                    <xsl:if test=”$nameCol”>
                        <th width=”50%” align=”left”>Name</th>
                    </xsl:if>
                    <th width=”50%” align=”left”>Information</th>
                </tr>
                <xsl:for-each select=”FieldsDoc/Fields/Field”>
                <tr>
                    <xsl:if test=”(position() +1) mod 2″><xsl:attribute name=”bgcolor”>#D4E4F3</xsl:attribute></xsl:if>
                    <xsl:if test=”$nameCol”>
                    <td><xsl:value-of select=”FieldName”/></td>
                    </xsl:if>
                    <td>
                        <xsl:choose>
                            <xsl:when test=”FieldValue[starts-with(., ‘www.’)]”>
                                <a target=”_blank”><xsl:attribute name=”href”>http://<xsl:value-of select=”FieldValue”/>
                                </xsl:attribute><xsl:value-of select=”FieldValue”/>
                                </a>
                            </xsl:when>
                            <xsl:when test=”FieldValue[starts-with(., ‘http:’)]”>
                                <a target=”_blank”><xsl:attribute name=”href”><xsl:value-of select=”FieldValue”/>
                                </xsl:attribute><xsl:value-of select=”FieldValue”/>
                                </a>
                            </xsl:when>
                            <xsl:when test=”FieldValue[starts-with(., ‘https:’)]”>
                                <a target=”_blank”><xsl:attribute name=”href”><xsl:value-of select=”FieldValue”/>
                                </xsl:attribute><xsl:value-of select=”FieldValue”/>
                                </a>
                            </xsl:when>
                            <xsl:when test=”FieldValue[starts-with(., ‘\\’)]”>
                                <a target=”_blank”><xsl:attribute name=”href”><xsl:value-of select=”FieldValue”/>
                                </xsl:attribute><xsl:value-of select=”FieldValue”/>
                                </a>
                            </xsl:when>
                            <xsl:when test=”FieldValue[starts-with(., ‘<img ‘)]”>
                                <xsl:value-of select=”FieldValue” disable-output-escaping=”yes” />
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select=”FieldValue”/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </td>
                </tr>
                </xsl:for-each>
            </table>
            </font>
        </body>
        </html>
    </xsl:template>
</xsl:stylesheet>

Well that’s it apologies for such a long post I hope it helps someone, and at the very least it will help me when I am look at doing something similar again!

NB: thanks to the following blogposts/threads Blogger Tutor, nmf to shp (on ESRI support)

ArcGIS Tip: Stop constant redraw of each data frame in data layout view.

Just a quick post for those that are interested.   When producing a large map in ArcGIS and using multiple data frames the redraw times will be painful.   If you are wanting to add other elements precisely and are zooming in and out all the time you may want to try switching your dataframes to draft mode.

  1. In layout view select your data frames (you can select muliple to save time).
  2. Click on the frame tab.
  3. Check the box at the bottom “Draft mode – just show name”

Hope this helps!

Article: Fit for Purpose? – dismal progress with LDFs

Article: Fit for Purpose? – dismal progress with LDFs

Yet more evidence has emerged recently which serves to underline the problems with the new plan-making system introduced only six years ago. Ministers hailed the Planning and Compensation Act, 2004 as heralding a new era in urban planning. They promised faster and cheaper plans and ones with more public engagement.

This article is written by Derrick where I work at Garsdale Design, LDFs from my perspective as a former Development Control Officer have always been mixed bag.   I understand the desire to improve and simplify the system but the LDF process has become more cumbersome than the previous Local Plan system.   It’s a shame because there were some good ideas in the LDF system and Planning is such an important part of government (national, regional and local).

Derrick highlights problems with actually completing this new LDF process by Local Planning Authorities and that Planners are of the opinion that this new system has not made quicker the process of plan making.   I’m sure anyone who has worked in a Local Authority as a Planner (Policy or Development Control) could tell you they don’t need a survey to tell them that!

My concern is that this plan making process is furthering the feeling of disenfranchisement that the public already have.   This is a difficult area, on the one hand a lot of the public feel big development will just be passed regardless of their opinion.  At the same time people applying for extensions or dwellings feel thwarted at every turn by red tape and strange ideas about what is accpetable development (I can’t have PVC windows?).   Yet Developers see the system as overly complicated and very slow.   Pleasing all sides was always going to be difficult.   Unfortunatley what’s certain is that the Planning system needs to change again, lets hope whoever gets in after the election learns from previous mistakes.