Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

from django.contrib.gis.db import models 

 

class MapConfig(models.Model): 

    """Model used for representing a map (ie a collection of styled map layers) 

 

        ======================  ============================================== 

        Attribute               Description 

        ======================  ============================================== 

 

        ``mapname``             Name of the map. Will be refered to by URL so  

                                use http friendly names (no spaces, slashes, etc) 

 

        ``mapfile``             Mapnik xml configuration file that defines data  

                                sources and styles. All paths within xml must be  

                                relative to media/staticmap/ 

 

        ``default_x1``          LL X coordinate 

 

        ``default_y1``          LL Y coordinate 

 

        ``default_x2``          UR X coordinate 

 

        ``default_y2``          UR Y coordinate 

 

        ``default_width``       Default image width (pixels) 

 

        ``default_height``      Default image height (pixels) 

        ======================  ============================================== 

""" 

 

    def __unicode__(self): 

        return u"%s" % (self.mapfile) 

 

    mapname = models.CharField(max_length=50,unique=True) 

    mapfile = models.FileField(upload_to='staticmap/', help_text=""" 

        Mapnik xml configuration file that defines data sources and styles.  

        All paths within xml must be relative to media/staticmap/ 

    """, blank=False, max_length=510) 

    default_x1 = models.FloatField( 

            help_text="Lower-left X coordinate of default map extent. Units and spatial reference system are defined in the mapnik xml.") 

    default_y1 = models.FloatField( 

            help_text="Lower-left Y coordinate of default map extent. Units and spatial reference system are defined in the mapnik xml.") 

    default_x2 = models.FloatField( 

            help_text="Upper-right X coordinate of default map extent. Units and spatial reference system are defined in the mapnik xml.") 

    default_y2 = models.FloatField( 

            help_text="Upper-right Y coordinate of default map extent. Units and spatial reference system are defined in the mapnik xml.") 

    default_width = models.IntegerField(help_text="Default map image width in pixels") 

    default_height = models.IntegerField(help_text="Default map image height in pixels") 

    default_srid = models.IntegerField(help_text="Spatial Reference ID of the output map", default=4326)